Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

webservices

  Asked By: Glenn    Date: Nov 27    Category: Java    Views: 1339
  

I am using JDeveloper for webservices(with soap).
Can any one please tell me how i should start,to send request and response to tht webservices.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Percy Morgan     Answered On: Nov 27

Oracle JDeveloper 9.0.3 has a built-in wizard to create java-clients (stubs) from wsdl file. I believe there are also other free ware tools.

When you get the required packages you can work it out with following high-level API example (extract)


package mypackage;

import oracle.soap.transport.http.OracleSOAPHTTPConnection;
import org.apache.soap.encoding.soapenc.BeanSerializer;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.util.xml.QName;
import java.net.URL;
import org.apache.soap.Constants;
import org.apache.soap.Fault;
import org.apache.soap.SOAPException;
import org.apache.soap.rpc.Call;
import org.apache.soap.rpc.Parameter;
import org.apache.soap.rpc.Response;
import java.util.Vector;
import java.util.Properties;

public class SOAPProfileManagerStub
{
public SOAPProfileManagerStub()
{
m_httpConnection = new OracleSOAPHTTPConnection();
m_smr = new SOAPMappingRegistry();
}


public String endpoint = "http://localhost/soap/SOAPProfileManagerService";
private OracleSOAPHTTPConnection m_httpConnection = null;
private SOAPMappingRegistry m_smr = null;

public Boolean isPermitted(String authCode, String element) throws Exception
{
Boolean returnVal = null;

URL endpointURL = new URL(endpoint);
Call call = new Call();
call.setSOAPTransport(m_httpConnection);
call.setTargetObjectURI("SOAPProfileManagerService");
call.setMethodName("isPermitted");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();
params.addElement(new Parameter("authCode", java.lang.String.class, authCode, null));
params.addElement(new Parameter("element", java.lang.String.class, element, null));
call.setParams(params);

call.setSOAPMappingRegistry(m_smr);

Response response  = call.invoke(endpointURL, "");

if (!response.generatedFault())
{
Parameter result = response.getReturnValue();
returnVal = (Boolean)result.getValue();
}
else
{
Fault fault = response.getFault();
throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
}

return returnVal;
}

}

 
Answer #2    Answered By: Aaron Kennedy     Answered On: Nov 27

Regarding generating stub for webservice for this following wsdl,
http://219.93.93.162:8022/MapService/MapViewer.asmx?WSDL

when i go for looking up the t-models in JDeveloper 10 g their is no mapservice/mapViewer which is webservice i have to use.
Wht might be the reason and how to resolve it?

 
Didn't find what you were looking for? Find more on webservices Or get search suggestion and latest updates.




Tagged: