on 07-24-2008 6:24 AM
hi
I am building a very simple application which will send email using a webservice.
i have followed following steps :
Import Web Service Model
WSDL : Browsed from local machine.
I follwed all steps as mentioned in SAP document for the same.
But while running this application i m getting following error :
Service call exception; nested exception is: java.rmi.RemoteException: The host of endpoint URL "http://www.abysal.com/soap/soapmail.wdtp" was not found. Check if the WS Client is configured correctly. Probably endpoint URL is not set or use of HTTP Proxy is required.; nested exception is: java.net.UnknownHostException: www.abysal.com
Please guide me if i have to do some configuration settings to use a web service.
Hi Naga,
I did selected as specified in document, "Import adaptive web service model"
Then in next step under select WSDL source I selected "Local file system or URL" Again as specified in document.
In next step I selected "No logical designation". Wereas in document "Use destination for metadata and execution" is selected.
It sems that this might be cause of my problem. The error which i am getting
"java.io.FileNotFoundException: C:\Documents and Settings\saurabh.agarwal\Desktop\AbysalEmail.wsdl (The system cannot find the file specified) "
Could u please explain me this point.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
to use adaptive web service model, create destinations for webservice as described in this document.
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naga
I did tried it again using "Adaptive Webservice model".
And XML provided by you in WSDL.
But now it is unable to read my WSDL file.
It is throwing following exception.
java.io.FileNotFoundException: C:\Documents and Settings\saurabh.agarwal\Desktop\AbysalEmail.wsdl (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)......
While i have checked it correctly that my file is located on this very location...!!
Can i use some path relative to my current project workspace...!!
please help me out.
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are using webservice model for email service
copy this below wsdl file.
<?xml version="1.0" encoding="UTF8" ?>
<definitions name="AbysalSendEmail" targetNamespace="http://www.abysal.com/AbysalwebDTP" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.abysal.com/AbysalwebDTP" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://www.abysal.com/AbysalwebDTP">
<xsd:element name="SendEmail">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="1" name="From" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="FromAddress" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="To" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="ToAddress" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="Subject" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="MsgBody" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="Acknowledgement" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="Priority" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SendEmailResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="ReturnCode" type="xsd:integer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="SendEmailInput">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Mail input parameters</documentation>
<part name="parameters" element="tns:SendEmail" />
</message>
<message name="SendEmailResponse">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Output parameters</documentation>
<part name="parameters" element="tns:SendEmailResponse" />
</message>
<portType name="SendEmailPortType">
<operation name="SendEmail">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Abysal Systems Web Service to send mail with WebDTP server</documentation>
<input message="tns:SendEmailInput" />
<output message="tns:SendEmailResponse" />
</operation>
</portType>
<binding name="SendEmailBinding" type="tns:SendEmailPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="SendEmail">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="SendEmailService">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Abysal Systems Web Service demonstration example</documentation>
<port binding="tns:SendEmailBinding" name="SendEmailPort">
<soap:address location="http://www.abysal.com/soap/soapmail.wdtp" />
</port>
</service>
</definitions>
Use the below code to execute
try {
Request_SendEmailPortType_sendEmail obj=new Request_SendEmailPortType_sendEmail();
wdContext.nodeRequest_SendEmailPortType_sendEmail().bind(obj);
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setFrom("naga");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setFromAddress("sender email");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setMsgBody("hai hello");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setPriority("high");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setSubject("sub");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setTo("nagaraju");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().setToAddress("receiver email");
wdContext.currentRequest_SendEmailPortType_sendEmailElement().modelObject().execute();
wdContext.nodeResponse().invalidate();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try with Using Adaptive Webservice model
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.