This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Convert String into SOAP envelope object.

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi - How do you convert a String object into a soap envelope with
org.apache.soap.*; ??

Receive soap message =
Envelope env = msg.receiveEnvelope();
Body retbody = env.getBody();
java.util.Vector v = retbody.getBodyEntries();

The avbove code works great when I receivce the envelope over http, but I'm trying to build a developemnt tool that can use a hard coded String like the below to test/develop with. Having a hard time getting into proper object type. Please advise??

String soapText =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<soap:Envelope "
+ "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+ "<soap:Body>"
+ "<TpclCommareaMethodResponse "
+ "xmlns=\"http://TpclCommareaMethod.SSZ0TPCL.x4mlsoa.com/CA/AAZ0ABCD/$ZL#D001\">"
+ "<DFHCOMMAREA "
+ "FULL-DATE-OUT=\"10/08/2007\" "
+ "FULL-TIME-OUT=\"10:32:22\" "
+ "APPLID-OUT=\"A07TPCIL\" "
+ "SYSID-OUT=\"TPCL\" "
+ "EIBTASKN-NBR-OUT=\"0004516\" "
+ " /> "
+ "</TpclCommareaMethodResponse>"
+ "</soap:Body>"
+ "</soap:Envelope>";

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glancing at the Axis 1.4 JavaDocs for Message, it appears that there is a set of constructors that take an "initialConents Object" where:

initialContents - may be String, byte[], InputStream, SOAPEnvelope, or AxisFault.



Therefore you should be able to get that Message directly constructed from the String instead of the InputStream.

Bill
 
Dave Ersk
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Bill !

I'll convert from org.apache.soap to org.apache.axis and give it a whirl.

Regards,
Dave
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic