• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

raw xml as the payload

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to send raw xml as the parameter for a web service call?

I have a web-service that I'm trying to consume which gives me errors each time I attempt to call it. The service is implemented using Microsoft Soap Toolkit 3.0 and the call has been proven to work using the following VB script:


However, when I try and access this service using axis-1.4 and sending the request as raw xml I get a 500 Internal Server Error.

The request looks like this:


It sends the html values for the < and >.

Which obviously doesn't work... Is it possible to send a request like this?

Or should the web service be parameterized?

Thanks,
Graham
[ November 01, 2007: Message edited by: graham king ]
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Apache TCPMon to intercept the request issued and response received by the VB script. That will give you a better base for comparison.

Is there a particular reason why you aren't using WSDL2Java on ALMVTC.WSDL so that Axis can generate the Java stubs?

If it still doesn't come out right there may be ways to tweak the WSDL for Axis.

Other than that Axis seems to deal with raw XML only in the Message services style.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could not even get your VBscript to work. It failed with the following message:

initialization failed WSDLOperation:
The operation getCandidateScheduleData is defined with encoded-style but has no encoding attribute
HRESULT=0x80004005: Unspecified error - WSDLOperation:Initializing of the input message failed for operation getCandidateScheduleData
HRESULT=0x80004005: Unspecified error - WSDLPort:An operation for port ScheduleSoapPort could not be initialized
HRESULT=0x80004005: Unspecified error - WSDLPort:Analyzing the binding information for port ScheduleSoapPort failed
HRESULT=0x80004005: Unspecified error - WSDLService:Initialization of the port for service ALMVTC failed
HRESULT=0x80004005: Unspecified error - WSDLReader:Analyzing the WSDL file failed
HRESULT=0x80004005: Unspecified error - Client ne of the parameters supplied is invalid.
HRESULT=0x80070057: The parameter is incorrect.

After I added a

encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

in the right place it started to work.

This is the request that the VBscript/MS Soap Toolkit 3.0 sent:


As you can see even this request doesn't have the string as literal XML either - so that can't be the problem. The most glaring difference between this request and the one that your axis code generated is the lack of the SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" attribute in the Axis request.

If you have a close look at the WSDL that you supplied you should notice something peculiar. The WSDL specifies a "rpc/encoded" style binding for the getCandidateScheduleData operation input binding but then it specifies a "rpc/literal" style binding for the getCandidateScheduleData operation output binding!!!

Every SOAP web service I have ever run across used the same style on both the input and output! This must have confused Axis and it fell back onto "rpc/literal" when the actual web service was expecting "rpc/encoded". Once you tweak the WSDL to list both input and output as "encoded" Axis creates the correct request. Here is the relevant WSDL segment:


Axis Client Code:


Resulting request from Axis client code:


Note however the difference in the location of the encodingStyle attribute. The MS SOAP3 places it inside the SOAP body element. Axis on the other hand places it inside the getCandidateScheduleData element. According to the SOAP 1.1 Note this should not matter � but who knows.
 
No more fooling around. Read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic