Author Message
KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline
Hi Team,

I'm using OD 7.0.1 to develope a VXML/Java application which uses AXIS 2 WSOP to access a SOAP 1.2 based web service and get some errors. Please see the excerpt from the errors below:

09/09/2015 13:19:10:505 INFO - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Calling method [{http://XYZ.Core.BizTalk.Common.Schemas.PINChange}Authentication] on web service [BizTalkServiceInstance] at [https://cardservice-dev.xyz.net/ManagePIN.svc]
java.lang.IllegalArgumentException: Cannot create a prefixed element with an empty namespace name
at org.apache.axiom.om.impl.llom.OMElementImpl.handleNamespace(OMElementImpl.java:195)
at org.apache.axiom.om.impl.llom.OMElementImpl.setNamespace(OMElementImpl.java:913)
at org.apache.axiom.om.impl.llom.OMElementImpl.<init>(OMElementImpl.java:148)
...
...
...
...

09/09/2015 13:19:10:572 INFO - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Using Basic/Digest authentication for web service call
09/09/2015 13:19:10:574 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Web Service Request -> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body /></soapenv:Envelope>
09/09/2015 13:19:10:603 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Axis Fault message <- Transport error: 415 Error: Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.
09/09/2015 13:19:10:604 ERROR - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Got AxisFault during web service call: Transport error: 415 Error: Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.
09/09/2015 13:19:10:604 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Fault action <- null
09/09/2015 13:19:10:604 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Fault node <- null
09/09/2015 13:19:10:604 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Fault role <- null
09/09/2015 13:19:10:604 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Fault type <- 0
09/09/2015 13:19:10:605 DEBUG - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Fault message <- Transport error: 415 Error: Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.
09/09/2015 13:19:10:657 INFO - 5A71C50F0FF1FC0CB2C385F79F212F1E:/TWGFS_PIN : Capturing exception [org.apache.axis2.AxisFault]. Message [Transport error: 415 Error: Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.]
***** Saw exception, tracing before report
org.apache.axis2.AxisFault: Transport error: 415 Error: Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.
at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:310)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:404)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)



Any thoughts what could be the issue?

If you need more details, kindly tell me your email address and I will email you the WSDL and complete log file.

Many thanks.



KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline

Hi Team,

Did anyone get a chance to look at it?

Unfortunately, I have tight timeline from the customer to resovle this issue which is stopping to get the main application development underway.



Thanks.
KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline
Just to add to the previous information, the web service that I'm trying to consume in OD has been developed in .Net. Would this be supported to consume using WSOP?

Also I have googled a bit and seems there is a difference in content-type on client and server side. So for SOAP 1.2 it has to be application/soap+xml.

Now I have tried to add an http header "Content-Type" with a variable value of "application/soap+xml" in WSOP settings - tried all directions i.e. in, out and InOut but still no luck.

This time it throws an error:

Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers at [row,col {unknown-serouce}]: [1,50]

I need help!
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
You should be able to access .NET web services using WSOPs, but it's not a guarantee.

For the first error, take a look at this post:

http://www.devconnectprogram.com/forums/posts/list/17185.page

For the 415 error, you should be able to add in headers and fix it. However, it seems that you've done that and are getting a different error now? The DOCTYPE one? There's a smattering of reasons for it, and it's unclear which is the right one. For some, fixing the port was the answer. You might have to write some Java to invoke the service and set everything manually, if it isn't working using WSOPs. If you're unsure how to do it, you can attach your WSDL here and I can provide some code.
KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline

Hi Samaresh,

Sorry I have sent the WSDL (along with credentials) and other details on your email address without your permission: srkowshik@avaya.com

Thanks for your help in advance.



KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline
Hi Samaresh,

Did you get a chance to have another look at your email?


Thanks.
KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline
I never thought that consuming a .net based web service in OD/Eclipse will be a cumbersome task but now I have have exhausted all the options and need help or answers from Avaya DevConnect forum.

I'm trying to consume a customer-provided SOAP1.2 based web service developed in .net - See the attached WSDL file.

The customer requires that the Request must be sent in the followign format to consume the web service succefully:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:twg="http://TWGFS.Core.BizTalk.Common.Schemas.PINChange" xmlns:a="http://www.w3.org/2005/08/addressing" >
<soap:Header>
<a:Action soap:mustUnderstand="1">http://TWGFS.Core.BizTalk.Common.Schemas.PINChange/ManagePIN/AuthenticationRequest</a:Action>
<a:To soap:mustUnderstand="1">https://cardservice-test.twgfs.net/ManagePIN.svc</a:To>
</soap:Header>
<soap:Body>
<twg:Authentication>
<RequestID>1234</RequestID>
<EncryptionSessionID>129b1234-3b6f-4ae2-a171-2470b63dff12</EncryptionSessionID>
<CardInstanceID>123456789012</CardInstanceID>
</twg:Authentication>
</soap:Body>
</soap:Envelope>

Now I did host this attached WSDL in SoapUI tool and manually pasted the above Request in the request and I got the correct expected response from the web service.

But I am unable to create and send this request in OD 7.0.1.

Using the attached WSDL, WSOP creates below Request by default which is not even a SOAP 1.2 request:

Web Service Request -> <?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:Authentication xmlns:ns1="http://TWGFS.Core.BizTalk.Common.Schemas.PINChange">
<RequestID>1234</RequestID>
<EncryptionSessionID>129b1234-3b6f-4ae2-a171-2470b63dff12</EncryptionSessionID>
<CardInstanceID>123456789012</CardInstanceID>
</ns1:Authentication>
</soapenv:Body>
</soapenv:Envelope>

Looking at some other thread on this forum I have been able to modify the default Request created by WSOP as follows.

Web Service Request -> <?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<a:Action>http://TWGFS.Core.BizTalk.Common.Schemas.PINChange/ManagePIN/AuthenticationRequest</a:Action>
<a:To>https://cardservice-test.twgfs.net/ManagePIN.svc</a:To>
</soapenv:Header>
<soapenv:Body>
<twg:Authentication xmlns:twg="http://TWGFS.Core.BizTalk.Common.Schemas.PINChange">
<RequestID>6789</RequestID>
<EncryptionSessionID>067e1234-3b6f-4ae2-a171-2470b63dff00</EncryptionSessionID>
<CardInstanceID>123456789012</CardInstanceID>
</twg:Authentication>
</soapenv:Body>
</soapenv:Envelope>

For this modification I had to add Content-Type="application/soap+xml" HTTP header; and ACTION and TO as SOAP headers in WSOP. In addition I have also used below code snipet:

In short still the Request message is not the same as required by the customer web service. For example Envelope is missing couple of entries (i.e. xmlns:twg="http://TWGFS.Core.BizTalk.Common.Schemas.PINChange" xmlns:a="http://www.w3.org/2005/08/addressing"). mustUnderstand="1" is missing in both ACTION and TO elements. And also Name Space "soapenv" should be "soap" in Envelope, Body and Header tags.

I have also tried doing something with manual invokation in java using the stub created by WSOP but I don't know how to change the request format as required by the customer web service. I don't even know how to see SOAP message in debug variables or trace in this manual invokation method. This stub doesn't even change the SOAP format to 1.2 even by using the following statement: stub._getServiceClient().getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);

Is there anyone who can solve my problem and provide me some working sample application or code? I'm absolutely stuck.
Filename WSDL_File.xml [Disk] Download
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Are you using Axis1.4 or Axis 2? Have you tired this in both Axis 1.4 and 2?
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
You could also try JAX-WS.
KNaseer
Joined: Oct 29, 2009
Messages: 62
Offline
I have tried both Axis 1.4 and 2.

Using Axis 1.4 doesn't load the methods on WSOP wizard. It gets stuck and doesn't come back. And Finish/OK option on the wizard is diabled. Closing the wizard doesn't create any WSOP. Don't know the reason for that.

So I'm using Axis2 which loads the methods on WSOP wizard and WSOP is created successfully.

Re JAX-WS, can you help me start on this keeping my WSDL in mind - any sample code?

Thanks.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
UNfortunately not, I have not used JAX-WS. IT was just a thought.
Go to:   
Mobile view