- This topic has 6 replies, 3 voices, and was last updated 17 years, 8 months ago by tomeksz.
-
AuthorPosts
-
Ronald R DiFrangoMemberAll,
I am attempting to create a Web Service Client, where the communication protocol is JMS. The exception I get is the following:
Exception in thread “main” org.codehaus.xfire.XFireRuntimeException: Could not find transport for binding http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS
at org.codehaus.xfire.client.XFireProxyFactory.create(XFireProxyFactory.java:141)
at com.circuitcity.myecplise.AsyncWebServiceClient.getEndpoint(AsyncWebServiceClient.java:56)
at com.circuitcity.myecplise.AsyncWebServiceClient.getEndpoint(AsyncWebServiceClient.java:68)
at com.circuitcity.myecplise.AsyncWebServiceClient.getAsyncWebServiceJMSPort(AsyncWebServiceClient.java:107)
at com.circuitcity.myecplise.AsyncWebServiceClient.main(AsyncWebServiceClient.java:135)Here is the WSDL source:
<?xml version=”1.0″ encoding=”UTF-8″?>
<!–Created by TIBCO WSDL–>
<wsdl:definitions xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/ <http://schemas.xmlsoap.org/wsdl/> ” xmlns:tns=”http://xmlns.example.com/1172758360539/AsyncOperationImpl <http://xmlns.example.com/1172758360539/AsyncOperationImpl> ” xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/ <http://schemas.xmlsoap.org/wsdl/soap/> ” xmlns:jms=”http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS <http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS> ” xmlns:jndi=”http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi <http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi> ” xmlns:ns0=”http://www.circuitcity.com/uploadDemo <http://www.circuitcity.com/uploadDemo> ” name=”Untitled” targetNamespace=”http://xmlns.example.com/1172758360539/AsyncOperationImpl <http://xmlns.example.com/1172758360539/AsyncOperationImpl> “>
<wsdl:types>
<xs:schema xmlns=”http://www.circuitcity.com/uploadDemo <http://www.circuitcity.com/uploadDemo> ” xmlns:xs=”http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema> ” xmlns:attach=”http://ws-i.org/profiles/basic/1.1/xsd <http://ws-i.org/profiles/basic/1.1/xsd> ” targetNamespace=”http://www.circuitcity.com/uploadDemo <http://www.circuitcity.com/uploadDemo> ” elementFormDefault=”qualified” attributeFormDefault=”unqualified”>
<xs:element name=”additionalCharge”>
<xs:complexType>
<xs:sequence>
<xs:element ref=”ns0:code” minOccurs=”0″/>
<xs:element ref=”ns0:cost” minOccurs=”0″/>
<xs:element ref=”ns0:extendedCost” minOccurs=”0″/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=”brand” type=”xs:string”/>
<xs:element name=”cmCost”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”cmDate” type=”xs:string”/>
<xs:element name=”cmExtCost”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”cmNumber” type=”xs:string”/>
<xs:element name=”cmQuantity” type=”xs:decimal”/>
<xs:element name=”code” type=”xs:string”/>
<xs:element name=”cost”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”defTag” type=”xs:string”/>
<xs:element name=”extendedCost”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”fileName” type=”xs:string”/>
<xs:element name=”model” type=”xs:string”/>
<xs:element name=”qtyReasonCode” type=”xs:string”/>
<xs:element name=”row”>
<xs:complexType>
<xs:sequence>
<xs:element ref=”ns0:vendorNumber” minOccurs=”0″/>
<xs:element ref=”ns0:rtvNumber” minOccurs=”0″/>
<xs:element ref=”ns0:brand” minOccurs=”0″/>
<xs:element ref=”ns0:model” minOccurs=”0″/>
<xs:element ref=”ns0:rtvQuantity” minOccurs=”0″/>
<xs:element ref=”ns0:rtvCost” minOccurs=”0″/>
<xs:element ref=”ns0:rtvExtCost” minOccurs=”0″/>
<xs:element ref=”ns0:cmNumber” minOccurs=”0″/>
<xs:element ref=”ns0:cmDate” minOccurs=”0″/>
<xs:element ref=”ns0:cmQuantity” minOccurs=”0″/>
<xs:element ref=”ns0:cmCost” minOccurs=”0″/>
<xs:element ref=”ns0:cmExtCost” minOccurs=”0″/>
<xs:element ref=”ns0:unitOverShort” minOccurs=”0″/>
<xs:element ref=”ns0:qtyReasonCode” minOccurs=”0″/>
<xs:element ref=”ns0:defTag” minOccurs=”0″/>
<xs:element ref=”ns0:additionalCharge” minOccurs=”0″ maxOccurs=”unbounded”/>
</xs:sequence>
<xs:attribute name=”number” type=”xs:integer”/>
</xs:complexType>
</xs:element>
<xs:element name=”rtvCost”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”rtvExtCost”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”rtvNumber”>
<xs:simpleType>
<xs:restriction base=”xs:decimal”>
<xs:totalDigits value=”11″/>
<xs:fractionDigits value=”2″/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name=”rtvQuantity” type=”xs:decimal”/>
<xs:element name=”unitOverShort” type=”xs:decimal”/>
<xs:element name=”vendorNumber” type=”xs:string”/>
<xs:element name=”workbook”>
<xs:complexType>
<xs:sequence>
<xs:element ref=”ns0:row” minOccurs=”0″ maxOccurs=”unbounded”/>
</xs:sequence>
<xs:attribute name=”name” type=”xs:string”/>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name=”FileInputMessage”>
<wsdl:part name=”fileName” element=”ns0:fileName”/>
</wsdl:message>
<wsdl:portType name=”UploadInterface”>
<wsdl:operation name=”AsyncOperation”>
<wsdl:input message=”tns:FileInputMessage”/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name=”AsyncWebServiceBinding” type=”tns:UploadInterface”>
<soap:binding style=”document” transport=”http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS”/ <http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS”/> >
<jms:binding messageFormat=”bytes”/>
<wsdl:operation name=”AsyncOperation”>
<wsdl:documentation>The operation has no documentation</wsdl:documentation>
<soap:operation style=”document” soapAction=”/Automation/AsyncWebService”/>
<wsdl:input>
<soap:body use=”literal” namespace=”http://InputMessageNamespace <http://InputMessageNamespace> ” parts=”fileName”/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name=”AsyncWebService”>
<wsdl:port name=”AsyncWebServiceJMSPort” binding=”tns:AsyncWebServiceBinding”>
<soap:address location=””/>
<jms:connectionFactory>QueueConnectionFactory</jms:connectionFactory>
<jms:targetAddress destination=”queue”>RTVCRMS</jms:targetAddress>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>Is there a way to make this work?
Ron
Riyad KallaMemberMoving to OT > Soft Dev
tomekszMemberIts only guess ( i’ve never used JMS ) but maybe you try to replace http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS with urn:xfire:transport:jms and try client again
Ronald R DiFrangoMemberI tried that and I got a similar error:
Exception in thread “main” org.codehaus.xfire.XFireRuntimeException: Could not find transport for binding urn:xfire:transport:jms
at org.codehaus.xfire.client.XFireProxyFactory.create(XFireProxyFactory.java:141)
at com.circuitcity.myecplise.AsyncWebServiceClient.getEndpoint(AsyncWebServiceClient.java:56)
at com.circuitcity.myecplise.AsyncWebServiceClient.getEndpoint(AsyncWebServiceClient.java:68)
at com.circuitcity.myecplise.AsyncWebServiceClient.getAsyncWebServiceJMSPort(AsyncWebServiceClient.java:107)
at com.circuitcity.myecplise.AsyncWebServiceClient.main(AsyncWebServiceClient.java:135)
tomekszMembercan you post your client code ?
Ronald R DiFrangoMemberHere you go, please note that this is generated via the built-in MyEcplise pliging and directly from the WSDL:
package com.circuitcity.myecplise;
import java.net.MalformedURLException;
import java.util.Collection;
import java.util.HashMap;
import javax.xml.namespace.QName;
import org.codehaus.xfire.XFireRuntimeException;
import org.codehaus.xfire.aegis.AegisBindingProvider;
import org.codehaus.xfire.annotations.AnnotationServiceFactory;
import org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.jaxb2.JaxbTypeRegistry;
import org.codehaus.xfire.service.Endpoint;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.AbstractSoapBinding;
import org.codehaus.xfire.transport.TransportManager;public class AsyncWebServiceClient {
private static XFireProxyFactory proxyFactory = new XFireProxyFactory();
private HashMap endpoints = new HashMap();
private Service service0;
public AsyncWebServiceClient() {
create0();
Endpoint AsyncWebServiceJMSPortEP = service0.addEndpoint(new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“AsyncWebServiceJMSPort”), new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“AsyncWebServiceBinding”), “”);
endpoints.put(new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“AsyncWebServiceJMSPort”), AsyncWebServiceJMSPortEP);
Endpoint UploadInterfaceLocalEndpointEP = service0
.addEndpoint(
new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“UploadInterfaceLocalEndpoint”),
new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“UploadInterfaceLocalBinding”),
“xfire.local://AsyncWebService”);
endpoints
.put(
new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“UploadInterfaceLocalEndpoint”),
UploadInterfaceLocalEndpointEP);
}public Object getEndpoint(Endpoint endpoint) {
try {
return proxyFactory.create((endpoint).getBinding(), (endpoint)
.getUrl());
} catch (MalformedURLException e) {
throw new XFireRuntimeException(“Invalid URL”, e);
}
}public Object getEndpoint(QName name) {
Endpoint endpoint = ((Endpoint) endpoints.get((name)));
if ((endpoint) == null) {
throw new IllegalStateException(“No such endpoint!”);
}
return getEndpoint((endpoint));
}public Collection getEndpoints() {
return endpoints.values();
}private void create0() {
TransportManager tm = (org.codehaus.xfire.XFireFactory.newInstance()
.getXFire().getTransportManager());
HashMap props = new HashMap();
props.put(“annotations.allow.interface”, true);
AnnotationServiceFactory asf = new AnnotationServiceFactory(
new Jsr181WebAnnotations(), tm, new AegisBindingProvider(
new JaxbTypeRegistry()));
asf.setBindingCreationEnabled(false);
service0 = asf.create(
(com.circuitcity.myecplise.UploadInterface.class), props);
{
AbstractSoapBinding soapBinding = asf
.createSoap11Binding(
service0,
new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“UploadInterfaceLocalBinding”),
“urn:xfire:transport:local”);
}
{
AbstractSoapBinding soapBinding = asf
.createSoap11Binding(
service0,
new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“AsyncWebServiceBinding”),
“urn:xfire:transport:jms”);
}
}public UploadInterface getAsyncWebServiceJMSPort() {
return ((UploadInterface) (this).getEndpoint(new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“AsyncWebServiceJMSPort”)));
}public UploadInterface getAsyncWebServiceJMSPort(String url) {
UploadInterface var = getAsyncWebServiceJMSPort();
org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);
return var;
}public UploadInterface getUploadInterfaceLocalEndpoint() {
return ((UploadInterface) (this).getEndpoint(new QName(
“http://xmlns.example.com/1172758360539/AsyncOperationImpl”,
“UploadInterfaceLocalEndpoint”)));
}public UploadInterface getUploadInterfaceLocalEndpoint(String url) {
UploadInterface var = getUploadInterfaceLocalEndpoint();
org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);
return var;
}public static void main(String[] args) {
AsyncWebServiceClient client = new AsyncWebServiceClient();
//create a default service endpoint
UploadInterface service = client.getAsyncWebServiceJMSPort();//TODO: Add custom client code here
//
//service.yourServiceOperationHere();System.out.println(“test client completed”);
System.exit(0);
}}
— Interface class
package com.circuitcity.myecplise;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService(name = “UploadInterface”, targetNamespace = “http://xmlns.example.com/1172758360539/AsyncOperationImpl”)
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface UploadInterface {@WebMethod(operationName = “AsyncOperation”, action = “/Automation/AsyncWebService”)
@Oneway
public void asyncOperation(
@WebParam(name = “fileName”, targetNamespace = “http://www.circuitcity.com/uploadDemo”)
String fileName);}
tomekszMemberOk, looks like you need to manually register JMS transport
InitialContext context = new InitialContext(props);
QueueConnectionFactory qfactory = (QueueConnectionFactory)context.lookup(“MyQueueConnectionFactory”);
XFire xfire = XFireFactory.newInstance().getXFire();
JMSTransport transport = (JMSTransport) new JMSTransport(xfire, qfactory);
xfire.getTransportManager().register(transport);
ObjectServiceFactory sf = new ObjectServiceFactory(xfire.getTransportManager());
sf.addSoap11Transport(JMSTransport.BINDING_ID);Here is full article : http://datsystems.dnsalias.com/dokuwiki/doku.php?id=xfire
The article describe dynamic client, but as you see code is very similar to generated.
-
AuthorPosts