Tema: Re: Ka cia darau blogai?
Autorius: iso|ated
Data: 2009-01-17 09:27:02
kas blogai nezinau, reik ziuret koda, bet jei turi netbeansus ar eclipse ten 
kiek pamenu per 10 min galima sukurt web servisa
tiek serverio puse, tiek klientine.

"orcl" <a@a.a> wrote in message news:gkq9u4$gdd$1@trimpas.omnitel.net...
> Yra ws: http://www.ecubicle.net/iptocountry.asmx?wsdl
>
> kvieciant, meta klaida:
> Exception in thread "main" javax.xml.rpc.soap.SOAPFaultException: 
> System.Web.Services.Protocols.SoapException: Server was unable to process 
> request. ---> System.ArgumentNullException: Value cannot be null.
> Parameter name: input
>   at System.Text.RegularExpressions.Regex.Match(String input)
>   at System.Text.RegularExpressions.Regex.Match(String input, String 
> pattern)
>   at iptocountry.CheckInput(String IPv4)
>   at iptocountry.FindCountryAsString(String V4IPAddress)
>   --- End of inner exception stack trace ---
>        at 
> oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:540)
>        at 
> oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:390)
>        at 
> oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:110)
>        at 
> oracle.j2ee.ws.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:90)
>        at oracle.j2ee.ws.client.dii.BasicCall.invoke(BasicCall.java:678)
>
>
> KAIP CIA NUSIMUSA TAS PARAMETRAS (nes cia jau web service'o 
> exception'as )? GAL NE TAIP SETTINU?
>
> bandau iskviesti, rasydamas toki kod:
> <-------PRADZIA ------->
>    import java.net.URL;
>
>    import javax.xml.rpc.ServiceFactory;
>    import javax.xml.rpc.Service;
>    import javax.xml.rpc.Call;
>
>    import javax.xml.namespace.QName;
> import javax.xml.rpc.ParameterMode;
>
>    public class Ws {
>
>      public static void main(String[] args) throws Exception {
>
>        // Setup the global JAXM message factory
>        //System.setProperty("javax.xml.soap.MessageFactory",
>        //  "weblogic.webservice.core.soap.MessageFactoryImpl");
>        // Setup the global JAX-RPC service factory
>        //System.setProperty( "javax.xml.rpc.ServiceFactory",
>        //  "weblogic.webservice.core.rpc.ServiceFactoryImpl");
>
>        // create service factory
>        ServiceFactory factory = ServiceFactory.newInstance();
>
>        // define qnames
>        String targetNamespace = "http://www.ecubicle.net/webservices/";
>        String soapActionURI = 
> "http://www.ecubicle.net/webservices/FindCountryAsString";
>        Object[] params = new Object[1];
>        QName serviceName = new QName(targetNamespace, "iptocountry");
>        QName portName = new QName(targetNamespace, "iptocountrySoap");
>        QName operationName = new QName(targetNamespace, 
> "FindCountryAsString");
>        QName stringTypeQname = new 
> QName("http://www.w3.org/2001/XMLSchema", "string");
>
>        URL wsdlLocation = new 
> URL("http://www.ecubicle.net/iptocountry.asmx?wsdl");
>        // create service
>        Service service = factory.createService(wsdlLocation, serviceName);
>
>        // create call
>        Call call = service.createCall(portName, operationName);
>        // setting properties
>        call.setProperty(call.SOAPACTION_USE_PROPERTY, "true");
>        call.setProperty(call.SOAPACTION_URI_PROPERTY, soapActionURI);
>        // Set parameters
>        call.addParameter("V4IPAddress", stringTypeQname, 
> ParameterMode.IN);
>        call.setReturnType(stringTypeQname);
>        params[0] = "86.100.233.5";
>
>        // invoke the remote web service
>        Float result = (Float) call.invoke(params);
>
>        System.out.println("\n");
>        System.out.println("This example shows how to create a dynamic 
> client application that invokes a non-WebLogic Web service.");
>        System.out.println("The webservice used was 
> http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
>        System.out.println("The quote for BEAS is: ");
>        System.out.println(result);
>      }
>
>    }
> <-------PABAIGA ------->
>