File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Exception thrown while invoke .NET service from Java client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Exception thrown while invoke .NET service from Java client" Watch "Exception thrown while invoke .NET service from Java client" New topic
Author

Exception thrown while invoke .NET service from Java client

Pene charl
Greenhorn

Joined: Jun 14, 2011
Posts: 21

I had post the exception while to invoke .NET web service from java client.
Cant able to find out what is the exact problem behind this exception.
Please help me to resolved.

"SOAPException: faultCode=SOAP-ENV:IOException; msg=ModuleException thrown by HTTPClient while posting.HTTPClient.AuthSchemeNotImplException: NTLM; targetException=java.io.IOException: ModuleException thrown by HTTPClient while posting.HTTPClient.AuthSchemeNotImplException: NTLM"


Regards:Prince Charles
http://www.princecharl.blogspot.com
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
Exactly how did you construct this client software?

Specific toolkit? Are you starting with a WSDL provided by the service?

Bill
Vijay Rajagopal
Greenhorn

Joined: Aug 02, 2011
Posts: 2
Please post your client code snippet...

Re: If you're calling a .NET webservice, whats the return type of the exposed webmethod?

As a general advice, you need a build request XML using a parser and hit the webservice and also get the object from the webservice, and parse it back again.

Pene charl
Greenhorn

Joined: Jun 14, 2011
Posts: 21

I am not using any tool like AXIS.
Just using JDeveloper to create client stub and also got the WSDL service discription from server side,that WSDL generated based on .net.So it had used document style.
Is there any interoperability problem between .net and java?
When i make request to "https" service that's showed the exception.

I put my code snippet of client stub here:



//Initialization
m_httpConnection = new OracleSOAPHTTPConnection();
props.put(OracleSOAPHTTPConnection.PROXY_AUTH_TYPE, "basic");
props.put(OracleSOAPHTTPConnection.PROXY_USERNAME, "username");
props.put(OracleSOAPHTTPConnection.PROXY_PASSWORD, "password");
props.put(OracleSOAPHTTPConnection.PROXY_HOST, "host address");
props.put(OracleSOAPHTTPConnection.PROXY_PORT, "port no");
m_httpConnection.setProperties(props);
private String _endpoint = "https://URL/URN";

public String getEndpoint()
{
return _endpoint;
}

public void setEndpoint(String endpoint)
{
_endpoint = endpoint;
}

public String functionName(String Parameters) throws Exception
{
URL endpointURL = new URL(_endpoint);

Envelope requestEnv = new Envelope();
Body requestBody = new Body();
Vector requestBodyEntries = new Vector();

String wrappingName = "functionName";
String targetNamespace = "https: URL";
Vector requestData = new Vector();
requestData.add(new Object[] {"WSDL element", parameter passed by function});
requestData.add(new Object[] {"WSDL element", parameter passed by function});
......
requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
requestBody.setBodyEntries(requestBodyEntries);
requestEnv.setBody(requestBody);

Message msg = new Message();
msg.setSOAPTransport(m_httpConnection);
msg.send(endpointURL, "https://URL/URN(ie.functionName)", requestEnv);

Envelope responseEnv = msg.receiveEnvelope();
Body responseBody = responseEnv.getBody();
Vector responseData = responseBody.getBodyEntries();
return (String)fromElement((Element)responseData.elementAt(0), java.lang.String.class);
}


Please help me to resolve.
Pene charl
Greenhorn

Joined: Jun 14, 2011
Posts: 21

Pene charl wrote:I am not using any tool like AXIS.
Just using JDeveloper to create client stub and also got the WSDL service discription from server side,that WSDL generated based on .net.So it had used document style.
Is there any interoperability problem between .net and java?
When i make request to "https" service that's showed the exception.

I put my code snippet of client stub here:



//Initialization
m_httpConnection = new OracleSOAPHTTPConnection();
props.put(OracleSOAPHTTPConnection.PROXY_AUTH_TYPE, "basic");
props.put(OracleSOAPHTTPConnection.PROXY_USERNAME, "username");
props.put(OracleSOAPHTTPConnection.PROXY_PASSWORD, "password");
props.put(OracleSOAPHTTPConnection.PROXY_HOST, "host address");
props.put(OracleSOAPHTTPConnection.PROXY_PORT, "port no");
props.put("javax.net.ssl.trustStore", "/localdirectorypath");
props.put("javax.net.ssl.trustStorePassword", "password");
m_httpConnection.setProperties(props);
private String _endpoint = "https://URL/URN";

public String getEndpoint()
{
return _endpoint;
}

public void setEndpoint(String endpoint)
{
_endpoint = endpoint;
}

public String functionName(String Parameters) throws Exception
{
URL endpointURL = new URL(_endpoint);

Envelope requestEnv = new Envelope();
Body requestBody = new Body();
Vector requestBodyEntries = new Vector();

String wrappingName = "functionName";
String targetNamespace = "https: URL";
Vector requestData = new Vector();
requestData.add(new Object[] {"WSDL element", parameter passed by function});
requestData.add(new Object[] {"WSDL element", parameter passed by function});
......
requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
requestBody.setBodyEntries(requestBodyEntries);
requestEnv.setBody(requestBody);

Message msg = new Message();
msg.setSOAPTransport(m_httpConnection);
//Exception Occured here
msg.send(endpointURL, "https://URL/URN(ie.functionName)", requestEnv);
Envelope responseEnv = msg.receiveEnvelope();
Body responseBody = responseEnv.getBody();
Vector responseData = responseBody.getBodyEntries();
return (String)fromElement((Element)responseData.elementAt(0), java.lang.String.class);
}


Please help me to resolve.
Pene charl
Greenhorn

Joined: Jun 14, 2011
Posts: 21

I resolved that problem..
That issue based on JDeveloper.
Thanks to all ..
sac jay
Greenhorn

Joined: May 29, 2013
Posts: 1
HI Pene

I am facing a similar problem.
Could you please detail what problems were you facing using jDeveloper.
Could you please send your code as well so that i can refer to it.
Thanks.

Regards
Sachin
Pene charl
Greenhorn

Joined: Jun 14, 2011
Posts: 21

Hi Sachin,
The problem arose because i missed out some Jdeveloper specific JAR files,which is needed for the web service development in JDeveloper.
So you should make sure to included all the JAR files.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception thrown while invoke .NET service from Java client