You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Soyer, Muhammed A." <MS...@MICROS.COM> on 2008/09/10 21:59:40 UTC

Controlling the serialization

Hi,
Is it possible to control the serialization of the request messages.
I am using axis2 1.4.1 to call .Net web services and looks like the other part is not using the standard de-serialization APIs and I am getting issues.

Axis is serializing the request as below

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns2:FetchProfileRequest xmlns:ns2="http://htng.org/PWS/2008A/ZZZ/Name/Types">
         <ns2:ProfileID>1</ns2:ProfileID>
      </ns2:FetchProfileRequest>
   </soapenv:Body>
</soapenv:Envelope>


But the other part is expecting as below

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
    <FetchProfileRequest xmlns="http://htng.org/PWS/2008A/ZZZ/Name/Types">
      <ProfileID>1</ProfileID>
    </FetchProfileRequest>
  </soap:Body>
</soap:Envelope>

Is there an easy way to avoid axis using the namespace alias for each element and use it as the above message?

Thanks


Re: Controlling the serialization

Posted by Anne Thomas Manes <at...@gmail.com>.
I'm guessing that the server-side application is processing the XML as
strings rather than as XML. If they expect other applications to
interoperate with them, they will need to fix their service. It is
inappropriate to require specific character strings to be used for
namespace prefixes.

If you have no choice but to deal with their non-standard service, I
suspect your only option is to construct the entire message manually
using the javax.xml.namespace.QName class (i.e., don't have Axis2 do
it for you).

Anne

On Wed, Sep 10, 2008 at 9:07 PM, Soyer, Muhammed A. <MS...@micros.com> wrote:
> I am getting the below error at the client
>
>  org.apache.axis2.AxisFault: InputStream cannot be NULL.
>        at org.apache.axis2.transport.http.AbstractHTTPSender.processResponse(AbstractHTTPSender.java:214)
>        at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:265)
>        at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
>        at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
>        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
>        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
>        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
>        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
>        at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>        at com.micros.www.gcwebapi._3_1.GCWebAPIServiceStub.FetchProfile(GCWebAPIServiceStub.java:592)
>        at gcaxis.GCAxisTest.main(GCAxisTest.java:38)
>
> When look at the logs of the other side I am seeing errors indicating un-expected end of file ..
>
> And when I use a general purpose test tool it works fine with message using soap and creates the same error with the soapenv alias.
>
> I agree with you that these messages are semantically same.
>
> Thanks
>
>
>
> -----Original Message-----
> From: Anne Thomas Manes [mailto:atmanes@gmail.com]
> Sent: Wednesday, September 10, 2008 5:36 PM
> To: axis-user@ws.apache.org
> Subject: Re: Controlling the serialization
>
> The two messages are semantically the same. The .NET service should
> have no trouble deserializing it.
> What is the message you are receiving?
>
> Anne
>
> On Wed, Sep 10, 2008 at 3:59 PM, Soyer, Muhammed A. <MS...@micros.com> wrote:
>> Hi,
>>
>> Is it possible to control the serialization of the request messages.
>>
>> I am using axis2 1.4.1 to call .Net web services and looks like the other
>> part is not using the standard de-serialization APIs and I am getting
>> issues.
>>
>>
>>
>> Axis is serializing the request as below
>>
>>
>>
>> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>>
>>    <soapenv:Body>
>>
>>       <ns2:FetchProfileRequest
>> xmlns:ns2="http://htng.org/PWS/2008A/ZZZ/Name/Types">
>>
>>          <ns2:ProfileID>1</ns2:ProfileID>
>>
>>       </ns2:FetchProfileRequest>
>>
>>    </soapenv:Body>
>>
>> </soapenv:Envelope>
>>
>>
>>
>>
>>
>> But the other part is expecting as below
>>
>>
>>
>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>
>>  <soap:Body>
>>
>>     <FetchProfileRequest xmlns="http://htng.org/PWS/2008A/ZZZ/Name/Types">
>>
>>       <ProfileID>1</ProfileID>
>>
>>     </FetchProfileRequest>
>>
>>   </soap:Body>
>>
>> </soap:Envelope>
>>
>>
>>
>> Is there an easy way to avoid axis using the namespace alias for each
>> element and use it as the above message?
>>
>>
>>
>> Thanks
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Controlling the serialization

Posted by "Soyer, Muhammed A." <MS...@MICROS.COM>.
I am getting the below error at the client

  org.apache.axis2.AxisFault: InputStream cannot be NULL.
        at org.apache.axis2.transport.http.AbstractHTTPSender.processResponse(AbstractHTTPSender.java:214)
        at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:265)
        at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190)
        at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
        at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
        at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
        at com.micros.www.gcwebapi._3_1.GCWebAPIServiceStub.FetchProfile(GCWebAPIServiceStub.java:592)
        at gcaxis.GCAxisTest.main(GCAxisTest.java:38)

When look at the logs of the other side I am seeing errors indicating un-expected end of file ..

And when I use a general purpose test tool it works fine with message using soap and creates the same error with the soapenv alias.

I agree with you that these messages are semantically same.

Thanks



-----Original Message-----
From: Anne Thomas Manes [mailto:atmanes@gmail.com]
Sent: Wednesday, September 10, 2008 5:36 PM
To: axis-user@ws.apache.org
Subject: Re: Controlling the serialization

The two messages are semantically the same. The .NET service should
have no trouble deserializing it.
What is the message you are receiving?

Anne

On Wed, Sep 10, 2008 at 3:59 PM, Soyer, Muhammed A. <MS...@micros.com> wrote:
> Hi,
>
> Is it possible to control the serialization of the request messages.
>
> I am using axis2 1.4.1 to call .Net web services and looks like the other
> part is not using the standard de-serialization APIs and I am getting
> issues.
>
>
>
> Axis is serializing the request as below
>
>
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>
>    <soapenv:Body>
>
>       <ns2:FetchProfileRequest
> xmlns:ns2="http://htng.org/PWS/2008A/ZZZ/Name/Types">
>
>          <ns2:ProfileID>1</ns2:ProfileID>
>
>       </ns2:FetchProfileRequest>
>
>    </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
>
>
> But the other part is expecting as below
>
>
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>  <soap:Body>
>
>     <FetchProfileRequest xmlns="http://htng.org/PWS/2008A/ZZZ/Name/Types">
>
>       <ProfileID>1</ProfileID>
>
>     </FetchProfileRequest>
>
>   </soap:Body>
>
> </soap:Envelope>
>
>
>
> Is there an easy way to avoid axis using the namespace alias for each
> element and use it as the above message?
>
>
>
> Thanks
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Controlling the serialization

Posted by Anne Thomas Manes <at...@gmail.com>.
The two messages are semantically the same. The .NET service should
have no trouble deserializing it.
What is the message you are receiving?

Anne

On Wed, Sep 10, 2008 at 3:59 PM, Soyer, Muhammed A. <MS...@micros.com> wrote:
> Hi,
>
> Is it possible to control the serialization of the request messages.
>
> I am using axis2 1.4.1 to call .Net web services and looks like the other
> part is not using the standard de-serialization APIs and I am getting
> issues.
>
>
>
> Axis is serializing the request as below
>
>
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>
>    <soapenv:Body>
>
>       <ns2:FetchProfileRequest
> xmlns:ns2="http://htng.org/PWS/2008A/ZZZ/Name/Types">
>
>          <ns2:ProfileID>1</ns2:ProfileID>
>
>       </ns2:FetchProfileRequest>
>
>    </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
>
>
> But the other part is expecting as below
>
>
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>
>  <soap:Body>
>
>     <FetchProfileRequest xmlns="http://htng.org/PWS/2008A/ZZZ/Name/Types">
>
>       <ProfileID>1</ProfileID>
>
>     </FetchProfileRequest>
>
>   </soap:Body>
>
> </soap:Envelope>
>
>
>
> Is there an easy way to avoid axis using the namespace alias for each
> element and use it as the above message?
>
>
>
> Thanks
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org