How to make a dynamic proxy client in Java ME?
Hi guys!
I have an existing static stub web service client to WCF made by generating client stub feature of the Netbeans. How do I make this into a dynamic proxy?
tsubaki.pw wrote:
I have an existing static stub web service client to WCF. How do I make this into a dynamic proxy?What is the WCF?
Similar Messages
-
JAX-RPC Dynamic Proxy Client Question
I have a very simple web service successfully deployed using Tomcat 5 and Apache Axis. It simply takes a string and returns a String. Regardless, it's working.
Now I'm wanting to create a JAX-RPC dynamic proxy client as described on the following page:
http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXRPC5.html
There are numerous other articles out there describing the same method.
My problem is that I'm getting a ServiceException on the following line every time I try to run my client:
ServiceFactory factory = ServiceFactory.newInstance();
Would anyone have any ideas why this might be or what I might be missing? All the articles make it seem like this is just a trivial line and never mention much about it.
Any help would be appreciated. Thanks.Hello,
You are getting a service Exception on ServiceFactory.newInstance() method?
Actually, I have never seen this problem before. Is it possible that there are
classpath issues? That is, are you using just the jars from the jwsdp?
Regards,
Kathy -
No SOAPAction in dynamic proxy client
I am trying to consume a .NET Web service from a J2EE client. I am using a dynamic proxy client from http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXRPC5.html#wp79973
However, I am have a problem with the SOAPAction HTTP header. .NET requires this header element to be set but the proxy sends an empty SOAPAction header. What is the solution to this problem?message.getHeaders().addHeader("SoapAction","http://some.action.here");
this piece of code is not working. This what i'm using.
my .net service is running at ""http://192.168.4.214/dmwebservice/service1.asmx";" and my method name is "disconnect_cabinet"
mesg.getMimeHeaders().addHeader("POST" , " /dmwebservice/service1.asmx HTTP/1.1");
mesg.getMimeHeaders().addHeader("HOST" , " http://192.168.4.214");
mesg.getMimeHeaders().addHeader("SOAPAction", " http://tempuri.org/disconnect_cabinet");
the request & response is:
[java] **** request ****
[java] <?xml version="1.0" encoding="utf-8"?>
[java] <SOAP-ENV:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/so
ap/encoding" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs
d="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance"><SOAP-ENV:Header><SOAPAction xmlns="http://192.168.4.214/dmwebservice
/service1.asmx/disconnect_cabinet"/></SOAP-ENV:Header><SOAP-ENV:Body><disconnect
_cabinet xmlns="http://tempuri.org/"><credentials>123456</credentials></disconne
ct_cabinet></SOAP-ENV:Body></SOAP-ENV:Envelope>
[java] **** response ****
[java] <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="htt
p://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsu:Timestamp xmlns:wsu="h
ttp://schemas.xmlsoap.org/ws/2002/07/utility"><wsu:Created>2004-06-28T05:00:50Z<
/wsu:Created><wsu:Expires>2004-06-28T05:05:50Z</wsu:Expires></wsu:Timestamp></so
ap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>
System.Web.Services.Protocols.SoapHeaderException: The message is not a valid XM
L message ---> System.Xml.XmlException: 'soap' is an undeclared namespace. Li
ne 2, position 20.
[java] at System.Xml.XmlNSAttributeTokenInfo.FixNames()
[java] at System.Xml.XmlTextReader.ParseElement()
[java] at System.Xml.XmlTextReader.Read()
[java] at Microsoft.Web.Services.XmlSkipDTDReader.Read()
[java] at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
[java] at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, B
oolean preserveWhitespace)
[java] at System.Xml.XmlDocument.Load(XmlReader reader)
[java] at Microsoft.Web.Services.SoapEnvelope.Load(Stream stream)
[java] at Microsoft.Web.Services.WebServicesExtension.BeforeDeserializeS
erver(SoapMessage message)
what does this means and how can i fix? "The message is not a valid XML message ---> System.Xml.XmlException: 'soap' is an undeclared namespace. Line 2, position 20."
please let me know.
subhani. -
How to make a dynamic text be SMS by fl2.1
Now ,I know use " getURL("sms:"+telnumber) "to send sms to a
specified no.,but how to make a dynamic text be the sms content.?
Many thx!:Ciao,
this should work:
smstxt = "ciao, happy holidays";
telnum = "1234567890";
getURL("sms:"+telnum+"?body="+smstext);
body is a keyword.
Alessandro -
hello,
im running a dynamic proxy client for a simple web service. I have the web service up and running but when i run the client i get the following error:
run-client:
[java] java.lang.NoClassDefFoundError: dynamicproxy/BookClient
[java] Exception in thread "main"
[java] Java Result: 1
run:
BUILD SUCCESSFUL
Total time: 2 seconds
My client code is as follows:
package dynamicproxy;
import java.net.URL;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import dynamicproxy.BookIF;
public class BookClient{
public static void main(String[] args){
try{
String UrlString = args[0] + "?WSDL";
String nameSpaceUri = "urn:Foo";
String serviceName = "MyBookService";
String portName = "BookIFPort";
System.out.println("UrlString = " + UrlString);
URL bookWsdlUrl = new URL(UrlString);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service bookService = serviceFactory.createService(bookWsdlUrl,
new QName(nameSpaceUri, serviceName));
dynamicproxy.BookIF
myProxy = (dynamicproxy.BookIF)
bookService.getPort(new QName(nameSpaceUri, portName),
dynamicproxy.BookIF.class);
System.out.println("The sum of the 2 numbers is:");
System.out.println(myProxy.add(1, 2));
catch (Exception ex)
ex.printStackTrace();
Any ideas??thnx kwalsh1 i got it working. It was the targets.xml file in jaxrpc/common, i edited the package-dynamic to include all class files!
-
Hi all,
iam trying to use the dynamic proxy client with the following lines
String UrlString =
"http://localhost:8080/ProxyHelloWorld.wsdl";
String nameSpaceUri = "http://proxy.org/wsdl";
String serviceName = "HelloWorld";
String portName = "HelloIFPort";
URL helloWsdlUrl = new URL(UrlString);
ServiceFactory serviceFactory =
ServiceFactory.newInstance();
Service helloService =
serviceFactory.createService(helloWsdlUrl,
new QName(nameSpaceUri, serviceName));
//HelloIF myProxy = (HelloIF) helloService.getPort(
//new QName(nameSpaceUri, portName),
//proxy.HelloIF.class);
when i try to do this i get the following exception
Exception in thread "main" java.lang.NoSuchMethodError
at com.sun.xml.rpc.wsdl.parser.Util.verifyTagNSRootElement(Util.java:59)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLP
arser.java:191)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLP
arser.java:165)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitions(WSDLParser.ja
va:96)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parse(WSDLParser.java:91)
at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLMod
eler.java:85)
at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:
77)
at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBui
lder.java:96)
at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(Servic
eInfoBuilder.java:59)
at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService
.java:44)
at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactor
yImpl.java:32)
at JAXRPCClient.main(JAXRPCClient.java:38)
what am i doing wrong
sureshHi,
Yeah the Wsdl is hosted at http://localhost:8080/ProxyHelloWorld.wsdl.I also tried binding with a few xmethods service i get the same error.
same error. -
HOW TO MAKE WORKFLOW DYNAMIC..???
HI,
i am working on a workflow in which i have to assign users to a certain role but the problem which i am facing is that firslt all these roles were static i.e. they were hard coded earlier so the new roles which i am making,they are not reflecting in the workflow.
So can anyone help me as to how to make it dynamic so that the new rles which i am maiking should also start reflecting..Calculated field should help -
see here for more information on this topic,
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/400cc218-ea7f-4f9d-a3eb-c5289bdc05c4/sharepoint-designer-workflow-custom-subject-lines
http://sharepoint.stackexchange.com/questions/43301/how-to-set-the-subject-of-the-email-to-have-a-combination-of-static-words-and-fi
http://blog.henryong.com/2008/01/07/custom-sharepoint-designer-subject-lines-with-calculated-fields/
If the subject is predefined in list, you could try to populate the data from the list using string builder.
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you -
How to make a jar file from a java file?
how to make a jar file from a java file, is there any one tht can help me thank you;
You can study this.
http://java.sun.com/docs/books/tutorial/jar/basics/index.html -
How to make a data base connexion in java?
I have an oracle 7 data base that i want to connect how to make a data base connexion in java?
J
D
B
C
Search these forums or follow the JDBC tutorial -
How to make my dynamic form pages flow correctly?
I have created a dynamic form which has multiple questions with expandable text fields that will take multiple pages once completed. I do not know how to make the form flow correctly past the first page. I can attach the form if I knew how to do that.
Thank you Paul. Your editing assistance was greatly appreciated. I think I now understand that there should be only one page subform that is flowed, regardless of how many text box objects I have in my questionnaire. This did the trick.
-
Hi all,
I followed the web services devcloper pack tutorial and examples and was able to run the Proxy HelloClient example with the "ant run" command. But when I was trying to call it using >java I get
C:\java\jwsdp-1_0_01\docs\tutorial\examples\jaxrpc\proxy>java -classpath dist/proxy-client.jar;%CLASSPATH%;. proxy.HelloClient
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceFactory
at proxy.HelloClient.main(Unknown Source)
Shouldn't javax be in my Win (yes running Window 2000) env classpath already?
Also, I want to take this client code to a different machine (client) to run this to see if it can find the server for the remote calling. What files (.class, .xml, etc.) do I need to copy to the client machine to run it?
thanksHi,
I wanted to know the answer for the follg. question you had asked.
Kindly reply incase you know about it.
I want to take this client code to a different
machine (client) to run this to see if it can find the
server for the remote calling. What files (.class,
.xml, etc.) do I need to copy to the client machine to
run it?
thanks -
How to make an exe file from a java class file
i know one of the java's most powerfull properties is plataform independent, but if i have done one application (with GUI) that i want to run on Win32 for example, if anyone knows how to make it please send me a message to [email protected], how i know that can be make it? because HotJava is made in Java and in Win32 is a executable
Do a search on these forums for any of the thousands of times this question has been asked and any of the thousands of times it's been answered.
-
How to make a "Program" out of my .java files?
I have made a little application that stores a file to disk. Is there someway to make a file out of my .java files so it can be run without opening my editor and choosing run?
sorry I didn't check that, I can now run the jar command.
But even though I can create a .jar file I get an error. I have followed the guide that says I need to add the applications Entry point.
I have two classes:
saveDates.class //contains the main method
UserInput.claa // Parsing of user input
When I create the jar file I type:
jar cfe saveDates.jar SaveDates SaveDates.class UserInput.class
But when I try to run it like:
java -jar saveDates.jar
I get the error:
C:\workspace\dato>java -jar saveDates.jar
Exception in thread "main" java.lang.NoClassDefFoundError: SaveDates$1
at SaveDates.main(SaveDates.java:89)
C:\workspace\dato>
Do I need to change the main method someway? -
How to make EOIO for proxy messages in PI
Hi Experts,
We got different proxy outbound messages from ERP, we need to process all the messages in a sequence as it was sent from ERP, how can we make one queue in PI for all these messages.
Please give me some thoughts for this issue.Refer to these blogs:
XI: Reliable Messaging u2013 EOIO in ABAP Proxies
/people/arulraja.ma/blog/2006/08/18/xi-reliable-messaging-150-eoio-in-abap-proxies
ABAP PROXY TO FILE u2013 Handling Heavy Volumes in SAP PI
/people/praveen.gujjeti/blog/2010/05/31/abap-proxy-to-file-150-handling-heavy-volumes-in-sap-pi
Regards
Raj -
How to make crosstab dynamic?
I have this crosstab query by using DECODE function:
select engid,
max(decode(srv_period, '2012-1', Q1_Percentage, 0)) as "2012-1",
max(decode(srv_period, '2012-2', Q1_Percentage, 0)) as "2012-2"
from
+(+
select a.srv_year || '-' || a.srv_month as srv_period, trim(b.engid) as engid,
round((count(case when left(a.Q1_Product,1) in ('4', '5') then 1 else null end) * 100 / count(case when left(a.Q1_Product,1) in ('1', '2', '3', '4', '5') then 1 else null end)),2) as q1_percentage
from srv_main a,
biw_hda_event b
where a.evtnum = b.eveid
group by a.srv_year || '-' || a.srv_month, b.engid
+) group by engid+
How can I make the srv_period dynamic? The value of it comes from srv_main. srv_period fields.
Thanks in advance.Hi,
See thris thread:
Help for a query to add columns
Maybe you are looking for
-
DBMS_SCHEDULER.run_job problem
Hi friends.I have one problem. I use Oracle 10g(r2) in oracle enter.server. Also I can execute backupdb.sh script from terminal success.But I created Job sheduler as BEGIN DBMS_SCHEDULER.CREATE_JOB job_name => 'BACKUP_DB_JOB', job_type => 'EXECUTABLE
-
Final Cut Server as "regular" DAM
Hi people, I've been thinking if Final Cut Server can be used as a "regular" DAM, just like Extensis Portfolio, cataloging mostly images and nothing related to video media. If it can, that's a definitely good news, specially because Extensis solution
-
Removing alpha numeric characters
Hi, Can anybody please tell me how can I remove the alpha numeric characters, inluding spaces from a column value. Thanks in advance
-
Disabling Banner Page links for Page programatically
We have created pages and page groups programatically. We would like to disable banner page links like Customize, Refresh, Login/Logout from the page programatically. Can any one provide us any clues in this regard.Since we have about 200+ page under
-
BB10 Won't Sync via USB with iCal and Contact in Mac OS 10.8
I was able to transfer all of my data from my Torch to my new Z10 using Blackberry Link, but not it will not let me sync my contacts and iCal via USB cable. They "sync to device" tab is greyed out on the menu bar. In addtion, in spite of the fact th