complex data type in WLS10 webservices - weblogic.developer.interest.webservices.general(Archived)

Hi
I have a problem with a webservice method that return complex type. My method return a custom object "WebServiceTransactionDto" and this object contains, among other, a Collection (named historiques) of customs objects "TransactionDto"
If i try to use this method, I receive the following exception.
Erreur :Could not find binding for QNameProperty Historiques : BindingTypeName[java.util.Collection;t=Collection#java:java.util] Bean type :class ca.ssq.saac.transaction.transaction.dto.WebServiceTransactionDto XmlType {java:ca.ssq.saac.transaction.transaction.dto}WebServiceTransactionDto
It is easy to understand that the problem is my webservice do not know what is a "TransactionDto" object
Is there a way to define (with annotations maybe) the TransactionDto object so I could use the WebServiceTransactionDto as return type of one of my method?
I tried the weblogic.jws.Types annotation and while it works great with method that return directly a collection of complex object, i can't find a way to make it work with a complex object that contains a collection of another complex object.
If I try this:
#WebMethod()
#Types({"ca.ssq.saac.transaction.transactionElement.dto.TransactionElementDto"})
public WebServiceTransactionDto getDetailTransaction(String idTransaction, String env) throws SOAPFaultException {
...method...
}
I got compilation error:
[jwsc] [ERROR] - The WebMethod "getDetailTransaction" with a declared type of "ca.ssq.saac.transaction.transaction.dto.WebServiceTransactionDto" has an annotated alternative type of "ca.ssq.saac.transaction.transaction.dto.TransactionDto". The declared type "ca.ssq.saac.transaction.transaction.dto.WebServiceTransactionDto" and the annotated alternative type "ca.ssq.saac.transaction.transaction.dto.TransactionDto" must have an inheritance relationship between them.
I am using jwsc and clientgen task to generate my wsdl and my webservice application.
<jwsc
     verbose="true"
          srcdir="${src.dir}"
          destdir="${webServicesDist.dir}"
          destEncoding="ISO-8859-1">
          <classpath refid="webservices.classpath"/>           
               <module name="${webServicesWar}" explode="true" >
                    <jws file="/ca/ssq/saac/webservices/host/SaacWebServicesHost.java" />
                    <FileSet dir="${src.dir}" >
                         <include name="ca/ssq/saac/webservices/host/util/*.java" />
                    </FileSet>
                    
               </module>
          
     </jwsc>
     <clientgen
          wsdl="file:/${webServicesDist.dir}/communWS/WEB-INF/communwebservices.wsdl"
     destFile="${dist.dir}/${webServicesClient}"
          includeGlobalTypes="true"
          serviceName="communwebservices"
               packageName="ca.ssq.saac.webservices.client" />
Anyone have an idea on how to solve my problem?
If you guys need more information or precisions, plz feel free to ask.
Any help would be greatly appreciated.
Thank you very much
Jean-Philippe Leblond
--
Edited by jpleb31 at 02/01/2008 6:37 AM 

Try using the includeSchemas attribute in your jws task.
http://e-docs.bea.com/wls/docs100/webserv_ref/anttasks.html#wp1069899
The client should be okay since the return type is defined in the wsdl which you are generating based on. If not try creating a types jar file. One way is to use xquery workshop. Right click the schema or wsdl and select Web Services -> Generate Types Jar file.
Hope this helps.
Ryan 

Hi,
I have the same problem (weblogic 9.2). Using includeSchemas does not help as I don't use xmlBeans at all.
In my response class I have defined an array of an abstract class. At runtime concrete classes are instanciated and placed in the response object.
The problem is that jwsc can't see my concrete classes, hence they are missing in the generated WSDL.
I can't find any doc on this problem, did someone ever found a solution ??
Sylvain

Related

Problem with 'INOUT' parameter mode in Weblogic Server 7.0 with RPC-based web-service.

Service method in server :
public String echoString(String s, javax.xml.rpc.holders.StringHolder intHolder
)
Client code snippet :
call.addParameter("param0", xsdString, ParameterMode.IN);
call.addParameter("param1", xsdString, ParameterMode.INOUT);
But 'call.invoke' with two string objects give the following SOAPException:
javax.xml.rpc.soap.SOAPFaultException: Found SOAPElement
[<param1 xsi:type="xsd:string">40</param1>]. But was not able to
find a Part that is registered with this Message which
corresponds to this SOAPElement.
Things work fine for only IN parameter. I am attaching the
client code.
Any pointers to the problem would be appreciated.
[Client.java]
From the error message, it seems on the servre side the
the name of the part is not param1. Pls check the WSDL
and make sure that the name of the part is param1.
--
regards,
-manoj
"Kakoli" <kakoli#india.hp.com> wrote in message
news:3d896821$1#newsgroups.bea.com...
>
Service method in server :
public String echoString(String s, javax.xml.rpc.holders.StringHolderintHolder
)
Client code snippet :
call.addParameter("param0", xsdString, ParameterMode.IN);
call.addParameter("param1", xsdString, ParameterMode.INOUT);
But 'call.invoke' with two string objects give the followingSOAPException:
>
javax.xml.rpc.soap.SOAPFaultException: Found SOAPElement
[<param1 xsi:type="xsd:string">40</param1>]. But was not able to
find a Part that is registered with this Message which
corresponds to this SOAPElement.
Things work fine for only IN parameter. I am attaching the
client code.
Any pointers to the problem would be appreciated.
Hi Manoj,
There was no wsdl file in the war file. But, there was a web-services.xml, where
I edited to include param1. And it worked.
Thanks for putting me on the right track.
Now, my doubt is :
If the service method has a user-defined type as parameter , not primitive one,
then is there any example for that?
The web-services.xml in that case should contain the type-mapping with Serializer
and Deserializer class. Does weblogic provide any default classes for serializing
and deserializing java classes written in bean form on the lines of Apache-axis?
Thanking you,
Kakoli
"manoj cheenath" <manojc#bea.com> wrote:
From the error message, it seems on the servre side the
the name of the part is not param1. Pls check the WSDL
and make sure that the name of the part is param1.
--
regards,
-manoj
"Kakoli" <kakoli#india.hp.com> wrote in message
news:3d896821$1#newsgroups.bea.com...
Service method in server :
public String echoString(String s, javax.xml.rpc.holders.StringHolderintHolder
)
Client code snippet :
call.addParameter("param0", xsdString, ParameterMode.IN);
call.addParameter("param1", xsdString, ParameterMode.INOUT);
But 'call.invoke' with two string objects give the followingSOAPException:
javax.xml.rpc.soap.SOAPFaultException: Found SOAPElement
[<param1 xsi:type="xsd:string">40</param1>]. But was not able to
find a Part that is registered with this Message which
corresponds to this SOAPElement.
Things work fine for only IN parameter. I am attaching the
client code.
Any pointers to the problem would be appreciated.
"Kakoli" <kakoli#india.hp.com> wrote in message
news:3d8c6662#newsgroups.bea.com...
>
Hi Manoj,
There was no wsdl file in the war file.WSDL will be generated at run time from the web-services.xml file.
Point your browser to <url-of-the-service>?WSDL to get the WSDL.
But, there was a web-services.xml, where
I edited to include param1. And it worked.
Thanks for putting me on the right track.- cool
Now, my doubt is :
If the service method has a user-defined type as parameter , not primitiveone,
then is there any example for that?
The web-services.xml in that case should contain the type-mapping withSerializer
and Deserializer class. Does weblogic provide any default classes forserializing
and deserializing java classes written in bean form on the lines ofApache-axis?
WLS generate ser/deser at build time and do not have support for the generic
ser/deser for java beans. Generic ser/deser is slow because it use
reflection.
Also, there is no build time error checking.
Check out the servicegen and autotype ant tasks. They can do this work for
you.
>
Thanking you,
Kakoli
"manoj cheenath" <manojc#bea.com> wrote:
From the error message, it seems on the servre side the
the name of the part is not param1. Pls check the WSDL
and make sure that the name of the part is param1.
--
regards,
-manoj
"Kakoli" <kakoli#india.hp.com> wrote in message
news:3d896821$1#newsgroups.bea.com...
Service method in server :
public String echoString(String s, javax.xml.rpc.holders.StringHolderintHolder
)
Client code snippet :
call.addParameter("param0", xsdString, ParameterMode.IN);
call.addParameter("param1", xsdString, ParameterMode.INOUT);
But 'call.invoke' with two string objects give the followingSOAPException:
javax.xml.rpc.soap.SOAPFaultException: Found SOAPElement
[<param1 xsi:type="xsd:string">40</param1>]. But was not able to
find a Part that is registered with this Message which
corresponds to this SOAPElement.
Things work fine for only IN parameter. I am attaching the
client code.
Any pointers to the problem would be appreciated.

Using SOAPMessageHandlers in a JWS impl generated by WSDLC

I use the following to generate a JWS Impl from my WSDL
<wsdlc srcWsdl="${wsdl.file}" destJwsDir="${wsdl.output}" destImplDir="${wsdl.output}/impl" packageName="${pkg.name}" />
This creates a JWS Impl where the WebServie annotation has an endpointInterface.
How can I add a SOAPMessageHandler? Currently I use the following annotation:
#SOAPMessageHandlers ( {
#SOAPMessageHandler (className="package.SoapLogger")
} )
When I run JWSC via ANT I get the following:
[ERROR] - The annotation javax.jws.soap.SOAPMessageHandlers is not allowed on <SERVICE> when a javax.jws.WebService.endpointInterface is used.
How can I add a SOAPMessageHandler to a JWS file that has been generated from a WSDL?
Thanks in Advance. 
I was able to get this to work by adding
#SOAPMessageHandlers ( {
#SOAPMessageHandler (className="package.SoapLogger")
} ) to the Service Interface that was generated with the other Java artefacts by the WSDLC.
This is not ideal, especially as the Weblogic 9.2 documentation states that you should NEVER edit any of the generated Java artefacts.
Has anyone been able to add a SOAPMessageHandler to a webservice that has been created from a WSDL using the Weblogic 9.2 tools?
--
Edited by ma6rl at 05/22/2007 5:57 AM
--
Edited by ma6rl at 05/22/2007 5:57 AM 
We are seeing the same error. The documentation at http://e-docs.bea.com/wls/docs92/webserv/setenv.html#wp214603 indicates that the #HandlerChain, #SOAPMessageHandler, and #SOAPMessageHandlers annotations should be able to be specified in the implementation. Any help is appreciated. 
We had the same problem when upgrading from weblogic 9.1 to weblogic 9.2, but found that if you changed from using the #soapmessagehandlers annotation to a #handlerChain annotation, everything was ok again.

servicegen java.lang.OutOfMemoryError

Hi
I'm currently trying to use servicegen to generate webservices for a project.
However i would like to be able to specify the webservice definitions in a properties file and there by hiding some of the information from the developers when defining webservices.
However if i setup something like this:
<servicegen
     destEar="${destination}/${ear.filename}.ear"
     mergeWithExistingWS="true" warName="${webservice.war.filename}.war" keepGenerated="true">
     
               <service
               ejbJar="${destination}/${current.EJBJar}"
                    includeEJBs="${current.includeEJBs}" serviceName="${current.servicename}"
                    serviceURI="${current.serviceuri}"
               targetNamespace="${current.TargetNameSpace}"
               protocol="http" expandMethods="false"
               generateTypes="true" style="${current.Style}" useSoap12="${current.UseSoap12}">
               <handlerChain handlers="${webservice.handlerChain}"/>
               </service>
          
and then iterate throw each webservice definition and for each definition calling the above command.
However when i do this, it consumes a lot of memory and also the end result is a bigger file. I
any ideas

type-mapping not working correctly, get "Unable to find a javaType for the xmlType" WARNING

I'm manually creating a web-services.xml file, and using the autogen ant task to
generate the codec XML/Java classes. The XML definition is provided by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG. The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
{
public TestService()
{
}
public int serviceRequest(PaymentRequestCreate request)
{
System.out.println("Received serviceRequest message");
return 0;
}
public void testStringRequest(String request)
{
}
}
The web-service.xml file is attached, which contains the schema for the SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service method
that has a complex data type (non-built in data type) is not being deployed into
the WebLogic server. But the other service method that simply takes a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
[web-services.xml]
The first posting contains the wrong web-services.xml file. Please refer to this
one instead.
"JD" <john.d.smith#aa.com> wrote:
>
>
>
I'm manually creating a web-services.xml file, and using the autogen
ant task to
generate the codec XML/Java classes. The XML definition is provided
by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG.
The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have
registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is
simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
{
public TestService()
{
}
public int serviceRequest(PaymentRequestCreate request)
{
System.out.println("Received serviceRequest message");
return 0;
}
public void testStringRequest(String request)
{
}
}
The web-service.xml file is attached, which contains the schema for the
SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service
method
that has a complex data type (non-built in data type) is not being deployed
into
the WebLogic server. But the other service method that simply takes
a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition
and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class
files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate
the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into
the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to
the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document
throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
[web-services.xml]
Hi JD,
I spent a few cycles looking over your web-services.xml file, however I
don't have any suggestions other that one that looks like you have
already tried, at the top, in the <schema...>
targetNamespace="urn:sap-com:document:sap:business"
Making edits to these generated files can be tricky and my only
suggestion is to create a small reproducer to run by our outstanding
support team.
A quick look at our problem database shows one issue (CR095109) related
to a similar problem at deploy time that was fixed with 7.0SP3. Again,
the support folks will be able to help focus in on the issue.
Regards,
Bruce
JD wrote:
>
The first posting contains the wrong web-services.xml file. Please refer to this
one instead.
"JD" <john.d.smith#aa.com> wrote:
I'm manually creating a web-services.xml file, and using the autogen
ant task to
generate the codec XML/Java classes. The XML definition is provided
by SAP.
The ant build.xml file:
<project name="buildWebservice" default="stubgen">
<target name="stubgen">
<clientgen ear="C:\projects\RMIS\ifrrequests\RMIS.ear"
packageName="com.aa.rmis.webservice.client"
clientJar="C:\projects\RMIS\ifrrequests\rmisws-client.jar"
autotype="False" />
</target>
<target name="all" depends="stubgen"/>
</project>
The problem is seen below in the output from Ant. Note the WARNINIG.
The problem
is that the xml type cannot be mapped to the Java type.
C:\projects\RMIS\ifrrequests>ant -buildfile clientbuild.xml
Buildfile: clientbuild.xml
stubgen:
[clientgen] Generating client jar for RMIS.ear ...
[clientgen] WARNINIG: Unable to find a javaType for the xmlType:['urn:sap-com:do
cument:sap:business']:PaymentRequest.Create. Make sure that you have
registered
this xml type in the type mapping
[clientgen] Using SOAPElement instead
[clientgen] Compiling 4 source files to C:\DOCUME~1\944377\LOCALS~1\Temp\rmisws-
client.jar-836624340
[clientgen] Building jar: C:\projects\RMIS\ifrrequests\rmisws-client.jar
BUILD SUCCESSFUL
Total time: 17 seconds
The Java source that has the implementation of the service methods is
simply:
package com.aa.rmis.webservice;
import com.aa.rmis.ifr.request.*;
public class TestService
{
public TestService()
{
}
public int serviceRequest(PaymentRequestCreate request)
{
System.out.println("Received serviceRequest message");
return 0;
}
public void testStringRequest(String request)
{
}
}
The web-service.xml file is attached, which contains the schema for the
SAP PaymentRequest.Create
object definition.
Another problem I have, which is probably related, is that the service
method
that has a complex data type (non-built in data type) is not being deployed
into
the WebLogic server. But the other service method that simply takes
a String
parameter is.
The steps I took are:
1. Get XML from SAP Interface Repository (IFR) for PaymentRequest
2. Use ant task autogen to generate the request codec classes
3. Create the web-services.xml file by inserting the schema definition
and the
mapping file created by the autogen task, and defining the operations
4. Build web-services.war file that contains all autogen compiled class
files,
the web-services.xml file, and the service implementation class
5. Build the ear file that holds the web service files
6. Use the clientgen ant task to generate (included above) to generate
the client
jar file that should contain the proxy for both of the service methods
Environment:
* WebLogic 7.02
* JDK 1.3.1_06
* JBuilder 9 Enterprise
* Ant 1.4
Possible causes:
* Namespace not being used correctly
* copied verbatim the mapping xml file generated by autogen into
the web-services.xml
file
* xml-schema part of web-services.xml might not be set correctly
* operation definition might not be using the correct namespace
* Classpath used for ant might not be right
* Doubt this is the problem, but I'm out of other ideas
* Set by using the setWLEnv.cmd file provided by WebLogic
* Tried adding the generated classes directory for my project to
the classpath,
but did not work
I've been referencing the Programming WebLogic Web Services document
throughout
this entire process. I must be missing something.
Can anybody from BEA help me out with this problem?
Thanks in advance.
------------------------------------------------------------------------
Name: web-services.xml
web-services.xml Type: ACT Project (text/xml)
Encoding: base64

Getting exception for dynamic client for a webservice

My webservice URL is http://localhost:7001/MyWebservice/MyWebservice
In Build.xml file property name="namespace" value is http://localhost:7001.
When I use dynamic java client using WSDL as well as no WSDL , i got exceptions.
Use of WSDL:-
Exception in thread "main" javax.xml.rpc.JAXRPCException: failed to read wsdl fi
le:weblogic.webservice.tools.wsdlp.WSDLParseException: ERROR[WSDL Parser]:The ja
va Class of an xml name cannot be null:['java:eVisharad.BEMEE.Client.Data']:CLIC
oncept
at weblogic.webservice.core.rpc.ServiceFactoryImpl.createService(Service
FactoryImpl.java:33)
No WSDL :-
Exception in thread "main" java.lang.IllegalArgumentException: Unable to find a
javaType for the xmlType:['java:eVisharad.BEMEE.Client.Data']:CLCVCValue. Make s
ure that you have registered this xml type in the type mapping:TYPEMAPPING SIZE=0
Can anybody guide in this matter?
Thanks, Archana Padhye
Hi Archana,
This is because the XML type is not registered in the type mapping
registry. Hence the runtime do not know how to ser/deser this type.
An example on how to register types to typemapping is attched.
Is there any reason for using dynamic client? If you are using
stub client, clientgen will do all this work for you.
--
regards,
-manoj
"Archana Padhye" <Archana#Setuindia.com> wrote in message
news:3d2d2198$1#newsgroups2.bea.com...
>
My webservice URL is http://localhost:7001/MyWebservice/MyWebservice
In Build.xml file property name="namespace" value ishttp://localhost:7001.
When I use dynamic java client using WSDL as well as no WSDL , i gotexceptions.
>
Use of WSDL:-
Exception in thread "main" javax.xml.rpc.JAXRPCException: failed to readwsdl fi
le:weblogic.webservice.tools.wsdlp.WSDLParseException: ERROR[WSDLParser]:The ja
va Class of an xml name cannot benull:['java:eVisharad.BEMEE.Client.Data']:CLIC
oncept
atweblogic.webservice.core.rpc.ServiceFactoryImpl.createService(Service
FactoryImpl.java:33)
No WSDL :-
Exception in thread "main" java.lang.IllegalArgumentException: Unable tofind a
javaType for the xmlType.Data']:CLCV:['java:eVisharad.BEMEE.ClientCValue.Make s
ure that you have registered this xml type in the type mapping:TYPEMAPPINGSIZE=0
>
Can anybody guide in this matter?
Thanks, Archana Padhye[call4.jar]
Hello Manoj,
The example given uses no wsdl. I modified my code accordingly but still getting
errors. Can't I get rid of the URLs "http://www.mssoapinterop.org/asmx/simple.asmx"
and "http://soapinterop.org/xsd" ?
What if I want to use the wsdl?
The reason for using dynamic client : My server is offering a webservice and a jsp
running on the same server wants to access that webservice. So the situation is the
service and the client(jsp) are on the same server. So how can the client invoke
the service?
"manoj cheenath" <manojc#bea.com> wrote:
Hi Archana,
This is because the XML type is not registered in the type mapping
registry. Hence the runtime do not know how to ser/deser this type.
An example on how to register types to typemapping is attched.
Is there any reason for using dynamic client? If you are using
stub client, clientgen will do all this work for you.
--
regards,
-manoj
"Archana Padhye" <Archana#Setuindia.com> wrote in message
news:3d2d2198$1#newsgroups2.bea.com...
My webservice URL is http://localhost:7001/MyWebservice/MyWebservice
In Build.xml file property name="namespace" value ishttp://localhost:7001.
When I use dynamic java client using WSDL as well as no WSDL , i gotexceptions.
Use of WSDL:-
Exception in thread "main" javax.xml.rpc.JAXRPCException: failed to readwsdl fi
le:weblogic.webservice.tools.wsdlp.WSDLParseException: ERROR[WSDLParser]:The ja
va Class of an xml name cannot benull:['java:eVisharad.BEMEE.Client.Data']:CLIC
oncept
atweblogic.webservice.core.rpc.ServiceFactoryImpl.createService(Service
FactoryImpl.java:33)
No WSDL :-
Exception in thread "main" java.lang.IllegalArgumentException: Unableto
find a
javaType for the xmlType.Data']:CLCV:['java:eVisharad.BEMEE.ClientCValue.Make s
ure that you have registered this xml type in the type mapping:TYPEMAPPINGSIZE=0
Can anybody guide in this matter?
Thanks, Archana Padhye
"Archana Padhye" <Archana#Setuindia.com> wrote in message
news:3d326f93$1#newsgroups2.bea.com...
>
Hello Manoj,
The example given uses no wsdl. I modified my code accordingly but stillgetting
errors. Can't I get rid of the URLs"http://www.mssoapinterop.org/asmx/simple.asmx"
and "http://soapinterop.org/xsd" ?
What if I want to use the wsdl?The version of WLS you are using checked for the types at construction time
and
it failed because the right type mapping is not available at this time. This
is a bug
and it is fixed in the later version of WLS (i think SP1).
>
The reason for using dynamic client : My server is offering a webserviceand a jsp
running on the same server wants to access that webservice. So thesituation is the
service and the client(jsp) are on the same server. So how can the clientinvoke
the service?You can use static client very well in this use case. Do clientgen by
pointing to
the wsdl url. This will generate a XXX.jar. Put this jar file inside the
web-inf/lib
dir of the war (war which contains .jsp files). Then you call the web
service
form your jsp file as shown below:
new MyService_Impl().getMyPort().myMethod( ... );
>
"manoj cheenath" <manojc#bea.com> wrote:
Hi Archana,
This is because the XML type is not registered in the type mapping
registry. Hence the runtime do not know how to ser/deser this type.
An example on how to register types to typemapping is attched.
Is there any reason for using dynamic client? If you are using
stub client, clientgen will do all this work for you.
--
regards,
-manoj
"Archana Padhye" <Archana#Setuindia.com> wrote in message
news:3d2d2198$1#newsgroups2.bea.com...
My webservice URL is http://localhost:7001/MyWebservice/MyWebservice
In Build.xml file property name="namespace" value ishttp://localhost:7001.
When I use dynamic java client using WSDL as well as no WSDL , i gotexceptions.
Use of WSDL:-
Exception in thread "main" javax.xml.rpc.JAXRPCException: failed toread
wsdl fi
le:weblogic.webservice.tools.wsdlp.WSDLParseException: ERROR[WSDLParser]:The ja
va Class of an xml name cannot benull:['java:eVisharad.BEMEE.Client.Data']:CLIC
oncept
atweblogic.webservice.core.rpc.ServiceFactoryImpl.createService(Service
FactoryImpl.java:33)
No WSDL :-
Exception in thread "main" java.lang.IllegalArgumentException: Unableto
find a
javaType for thexmlType.Data']:CLCV:['java:eVisharad.BEMEE.ClientCValue.
Make s
ure that you have registered this xml type in the typemapping:TYPEMAPPING
SIZE=0
Can anybody guide in this matter?
Thanks, Archana Padhye
Great!! The solution given by Manoj worked !!
The process followed if anybody needed :
1)I am putting my JSPs at ..applications\DefaultWebApp and then
2)I extracted the XXX_client.jar that is inside war of the ear file of the webservice,
to ..applications\DefaultWebApp\WEB-INF\lib
3)Prefixed the classpath in the startweblogic.cmd by the webservices.jar (C:\bea\weblogic700\server\lib\webservices.jar)
4)Started the server
5)Ran the JSPs.
Thank you very much, Manoj.
>
>
You can use static client very well in this use case. Do clientgen by
pointing to
the wsdl url. This will generate a XXX.jar. Put this jar file inside
the
web-inf/lib
dir of the war (war which contains .jsp files). Then you call the web
service
form your jsp file as shown below:
new MyService_Impl().getMyPort().myMethod( ... );
The reason for using dynamic client : My server is offering a webserviceand a jsp
running on the same server wants to access that webservice. So thesituation is the
service and the client(jsp) are on the same server. So how can theclient
invoke
the service?
Yet the problem of using the dynamic client (use of WSDL / no use of WSDL) has
remained unresolved.
My main query is how to use user-defined complex datatypes as parameters of the
method ?
I attach a dynamic client that doesn't use WSDL .
I have tried to use the userdefined complex data type in it.
Running the client get following error.
Exception in thread "main" java.lang.IllegalArgumentException: Unable to find
a
javaType for the xmlType:['java:eVisharad.BEMEE.Common.CVC']:CVCRequestToken.
Make sure that you have registered this xml type in the type mapping:TYPEMAPPING
SIZE=0
Issue # 1078 answers that "This is because the XML type is not registered in the
type mapping registry."
But how to do that? The example cited in issue# 1078 is of little use.
[Main.java]
Hi Archana,
It looks like the problem is that you're not registering your "custom" data types
with the type mapper. Your Main.java class should have some lines in it that look
something like these:
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping mapping = registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING
);
mapping.register(
SOAPElement.class,
new QName("http://localhost:7001/CVCProxy/CVCProxy/WSDL/eVisharad.BEMEE.Client.EEService.CVCProxy",
"CVCRequestToken" ),
     new SOAPElementCodec(),
     new SOAPElementCodec()
);
I don't the name of the class for your "custom" data type (or it's codec), so
you'll need to replace the "SOAPElement.class" and "SOAPElementCodec" arguments
with the appropriate values :-)
Hope this helps,
Mike Wooten
"Archana Padhye" <Archana#Setuindia.com> wrote:
>
>
>
Yet the problem of using the dynamic client (use of WSDL / no use of
WSDL) has
remained unresolved.
My main query is how to use user-defined complex datatypes as parameters
of the
method ?
I attach a dynamic client that doesn't use WSDL .
I have tried to use the userdefined complex data type in it.
Running the client get following error.
Exception in thread "main" java.lang.IllegalArgumentException: Unable
to find
a
javaType for the xmlType:['java:eVisharad.BEMEE.Common.CVC']:CVCRequestToken.
Make sure that you have registered this xml type in the type mapping:TYPEMAPPING
SIZE=0
Issue # 1078 answers that "This is because the XML type is not registered
in the
type mapping registry."
But how to do that? The example cited in issue# 1078 is of little use.
Thanks. Actually instead of writing the ser/deser classes, I used the classes generated
by clientgen and for that I added the XXX_client.jar in the classpath. Whether
this a right way (having client_jar in the classpath) I don't know, but it worked.
Thanks once again.
-Archana Padhye
"Michael Wooten" <wooten_michael#hotmail.com> wrote:
>
Hi Archana,
It looks like the problem is that you're not registering your "custom"
data types
with the type mapper. Your Main.java class should have some lines in
it that look
something like these:
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping mapping = registry.getTypeMapping(SOAPConstants.URI_NS_SOAP_ENCODING
);
mapping.register(
SOAPElement.class,
new QName("http://localhost:7001/CVCProxy/CVCProxy/WSDL/eVisharad.BEMEE.Client.EEService.CVCProxy",
"CVCRequestToken" ),
     new SOAPElementCodec(),
     new SOAPElementCodec()
);
I don't the name of the class for your "custom" data type (or it's codec),
so
you'll need to replace the "SOAPElement.class" and "SOAPElementCodec"
arguments
with the appropriate values :-)
Hope this helps,
Mike Wooten

Categories

Resources