axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Shields <bgshie...@yahoo.com>
Subject Re: sending xml files as string parameters
Date Tue, 03 Feb 2004 17:15:55 GMT
Thanks Jeff,
Obviously ns1 is not a default namespace, but a default variable name for the urn:Foo namespace.
this is what i meant. I set urn:Foo as the namespace by using the setTargetObjectURI method
of the org.apache.soap.rpc.Call class. I just find it odd that it works perfectly when sent
to an Axis deployed service and falls down when sent to a JWSDP deployed service!
Brian.


Jeff <jeff@cogentlogic.com> wrote:Hi!
 
Clearly, the error message identifies the problem as the the opening tag of xmlFileParameter
element. Since you are using UTF-8, the error is obviously not due to character encoding.
The only other issue that comes to mind is the absence of a namespace: I'm speculating that
JWSDP may not be able to handle this. This guess could be wrong but what else can you try?
 
By definition, a prefix, in this case ns1, does not reference a default namespace!
 
As to how you add the xmlns="urn:Foo" attribute to the xmlFileParameter element, I don't know.
I gave up on Axis payload generation a while back because WSDL2Java has too many problems
(I use a commercial product to generate the payload and Axis to wrap it in SOAP and handle
message transmission/reception).
 
 
Jeff
 
 
----- Original Message ----- 
From: Brian Shields 
To: axis-user@ws.apache.org 
Sent: Tuesday, February 03, 2004 10:40 AM
Subject: Re: sending xml files as string parameters


How? that is an automatically generated SOAP message. I am simple creating a parameter...("xmlFileParameter,
String.class, xmlFile, Constants.NS_URI_SOAP_ENC); where xmlFile is the string containing
the xml file! II presume ns1 is a default namespace??
Brian

Jeff <jeff@cogentlogic.com> wrote:
Try using:
 
<ns1:xmlFileParameter ...
 
 
Jeff
 
----- Original Message ----- 
From: Brian Shields 
To: axis-user@ws.apache.org 
Sent: Tuesday, February 03, 2004 10:11 AM
Subject: sending xml files as string parameters


Hi all,
I am trying to send an xml file as a parameter in a web service call. This xml file is in
string form. I have created the string using the XMLOutputter class from the jdom.output package.
I send this to another locally hosted service, also deployed using axis, and everything works
fine. I can create a jdom Document from the string. However when i send the request to a remotely
hosted JWSDP deployed service i am getting an error. The error is:
deserialization error: unexpected XML reader state. expected: END but found: START: xmlFileParameter
where xmlFileParameter is the name of the Parameter added to the call.

I have caught the soap message arriving at the service, it is as following:
POST /LimaR/interface HTTP/1.0
Host: 127.0.0.1
Content-Type: text/xml; charset=utf-8
Content-Length: 2037
SOAPAction: ""

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:acceptXMLOrder xmlns:ns1="urn:Foo" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<xmlFileParameter xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;
&lt;PurchaseOrder xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:noNamespaceSchemaLocation=&quot;po.xsd&quot;&gt;
    &lt;poNumber&gt;jfd&lt;/poNumber&gt;
    &lt;shipTo&gt;
        &lt;name&gt;Alice Smith&lt;/name&gt;
        &lt;street&gt;123 Maple Street&lt;/street&gt;
        &lt;town-city&gt;Mill Valley&lt;/town-city&gt;
        &lt;state-county&gt;CA&lt;/state-county&gt;
        &lt;country&gt;USA&lt;/country&gt;
    &lt;/shipTo&gt;
    &lt;billTo&gt;
        &lt;name&gt;Robert Smith&lt;/name&gt;
        &lt;street&gt;8 Oak Avenue&lt;/street&gt;
        &lt;town-city&gt;Old Town&lt;/town-city&gt;
        &lt;state-county&gt;PA&lt;/state-county&gt;
        &lt;country&gt;USA&lt;/country&gt;
    &lt;/billTo&gt;
    &lt;comment&gt;Hurry, my lawn is going wild!&lt;/comment&gt;
    &lt;items&gt;
        &lt;item partNum=&quot;872-AA&quot;&gt;
            &lt;productName&gt;Lawnmower&lt;/productName&gt;
            &lt;quantity&gt;2&lt;/quantity&gt;
            &lt;USPrice&gt;12.12&lt;/USPrice&gt;
            &lt;comment&gt;Confirm this is electric&lt;/comment&gt;
        &lt;/item&gt;
        &lt;item partNum=&quot;926-AA&quot;&gt;
            &lt;productName&gt;Baby Monitor&lt;/productName&gt;
            &lt;quantity&gt;1&lt;/quantity&gt;
            &lt;USPrice&gt;390.98&lt;/USPrice&gt;
        &lt;/item&gt;
        &lt;totalPrice&gt;294.18&lt;/totalPrice&gt;
        &lt;shipDate&gt;2001-01-05&lt;/shipDate&gt;
    &lt;/items&gt;
&lt;/PurchaseOrder&gt;
</xmlFileParameter>
</ns1:acceptXMLOrder>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This one is really confusing me!! anyone have any ideas?
Thanks,
Brian



---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
Mime
View raw message