• CK_Young
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 10
    Replies
how can i  make the result.isSuccess() to be false?
i wan to test (result.isSuccess()==false)
 
forexample
 
Stirng updateflag = false
Account[] newAcct = new Account(name = 'Acme', billingcity = 'San Francisco');
for(Database.upsertResult result:Account) {
 if (result.isSuccess()==false){updateflag ==false};
}
for examle;
 
global class foo {
webservice string a;
webservice string b;
}

and then

global class my {
webservice static foo echoFoo(foo f) {
return f;
}
}
 
the WSDL for the ws class was included the definition of foo.
but   when I make the tools( WSDL2Java )to the ws.wsdl ,      foo.class is not appeared.
how can many classes  package into the same WSDL(same.wsdl)?
and then use the java-tools(WSDL2Java)  to the  WSDL(same.wsdl),and then i can find many classes just as api(Enterprise WSDL )?
 
for examle
 
class boy{
    string boymethod(){}
}
 
class girl{
string boymethod(){}
}
class friend{
string friendmethod(){}
}
 
how can i make the classes into the same wsdl,and then and then use the java-tools(WSDL2Java)  to the  WSDL(same.wsdl),i can find many classes (class boy,class girl,class friend).how can do it
global class  HelloWorld4{
 WebService static String sayHelloWorld(String arg) {
  return 'Hello '+arg; 
 } 
 WebService static String sayHelloWorld7(String arg) {  
  return 'Hello '+arg; 
 }
 class  HelloWorld5 {   
  String sayHelloWorld1111111(String arg) {
   return 'Hello '+arg;  
  }   
 } 
}
 
 
how can i make the @ class  HelloWorld5 @ into WSDL file?
can anyone help me,thanks:smileywink:
sample:
 
sObject s = [select id, name from account where ];
 
 
 
 

how can i get the count of select-result?

I code the sample,but error is appeared.Anyone can help me?

sObject s = [select count(id), name from account where ];

 

package com.sforce.soap.schemas._class.HelloWorld2;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.AxisFault;
import com.sforce.soap.enterprise.LoginResult;
import com.sforce.soap.enterprise.SessionHeader;
import com.sforce.soap.enterprise.SforceServiceLocator;
import com.sforce.soap.enterprise.SoapBindingStub;
public class WEBtest {
 public static void main(String[] args) throws RemoteException{
  
  try {
   HelloWorld2BindingStub binding = (HelloWorld2BindingStub) new HelloWorld2ServiceLocator().getHelloWorld2();
   
   SoapBindingStub  sub = (SoapBindingStub) new SforceServiceLocator().getSoap();
   sub.setTimeout(60000);
   sub = (SoapBindingStub) new SforceServiceLocator().getSoap();
   LoginResult loginResult;
   loginResult = sub.login("uuu@109.com","fffX4Ifsafasd0su9VSUyP87");
   
   binding._setProperty(HelloWorld2BindingStub.ENDPOINT_ADDRESS_PROPERTY,
                 loginResult.getServerUrl());
         SessionHeader sh = new SessionHeader();
         sh.setSessionId(loginResult.getSessionId());
         binding.setHeader(new HelloWorld2ServiceLocator().getServiceName().getNamespaceURI(),
                 "SessionHeader", sh);
     
   String a = binding.sayHelloWorld("s");
   System.out.print(a);
  } catch (ServiceException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 }
}
 
error
 
Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
 faultSubcode:
 faultString: No operation available for request {http://soap.sforce.com/schemas/class/HelloWorld2}sayHelloWorld
 faultActor:
 faultNode:
 faultDetail:
 {http://xml.apache.org/axis/}stackTrace:No operation available for request {http://soap.sforce.com/schemas/class/HelloWorld2}sayHelloWorld
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
 at javax.xml.parsers.SAXParser.parse(Unknown Source)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.sforce.soap.schemas._class.HelloWorld2.HelloWorld2BindingStub.sayHelloWorld(HelloWorld2BindingStub.java:214)
 at com.sforce.soap.schemas._class.HelloWorld2.WEBtest.main(WEBtest.java:37)
 {http://xml.apache.org/axis/}hostname:ck-b0de50bc7ace
No operation available for request {http://soap.sforce.com/schemas/class/HelloWorld2}sayHelloWorld
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
 at javax.xml.parsers.SAXParser.parse(Unknown Source)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.sforce.soap.schemas._class.HelloWorld2.HelloWorld2BindingStub.sayHelloWorld(HelloWorld2BindingStub.java:214)
 at com.sforce.soap.schemas._class.HelloWorld2.WEBtest.main(WEBtest.java:37)
apex code (sample):
 
global class  HelloWorld4{
 WebService static String sayHelloWorld(String arg) {
  return 'Hello '+arg;
 }
}
 

java code (sample):
 
  public class WEBtest {
      public static void main(String[] args) throws RemoteException{
      try {
             HelloWorld2BindingStub binding = (HelloWorld2BindingStub) new HelloWorld2ServiceLocator().getHelloWorld2();
             binding.setTimeout(60000);
            String a = binding.sayHelloWorld("s");
   System.out.print(a);
  } catch (ServiceException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 }
}
 
 
Exception in thread "main" AxisFault
 faultCode: {http://soap.sforce.com/schemas/class/HelloWorld2}INVALID_SESSION_ID
 faultSubcode:
 faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
 faultActor:
 
 
HOW CAN  i Passing paramenter through java client into webservice?
 
 
 
I created APEX code
 
for example
 
global class  HelloWorld4{
 WebService static String sayHelloWorld(String arg) {
  return 'Hello '+arg; 
 } 
}
 
 
How can I use it in client?
 
global class  HelloWorld4{
 WebService static String sayHelloWorld(String arg) {
  return 'Hello '+arg; 
 } 
 WebService static String sayHelloWorld7(String arg) {  
  return 'Hello '+arg; 
 }
 class  HelloWorld5 {   
  String sayHelloWorld1111111(String arg) {
   return 'Hello '+arg;  
  }   
 } 
}
 
 
how can i make the @ class  HelloWorld5 @ into WSDL file?
can anyone help me,thanks:smileywink:
sample:
 
sObject s = [select id, name from account where ];
 
 
 
 

how can i get the count of select-result?

I code the sample,but error is appeared.Anyone can help me?

sObject s = [select count(id), name from account where ];

 

package com.sforce.soap.schemas._class.HelloWorld2;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.AxisFault;
import com.sforce.soap.enterprise.LoginResult;
import com.sforce.soap.enterprise.SessionHeader;
import com.sforce.soap.enterprise.SforceServiceLocator;
import com.sforce.soap.enterprise.SoapBindingStub;
public class WEBtest {
 public static void main(String[] args) throws RemoteException{
  
  try {
   HelloWorld2BindingStub binding = (HelloWorld2BindingStub) new HelloWorld2ServiceLocator().getHelloWorld2();
   
   SoapBindingStub  sub = (SoapBindingStub) new SforceServiceLocator().getSoap();
   sub.setTimeout(60000);
   sub = (SoapBindingStub) new SforceServiceLocator().getSoap();
   LoginResult loginResult;
   loginResult = sub.login("uuu@109.com","fffX4Ifsafasd0su9VSUyP87");
   
   binding._setProperty(HelloWorld2BindingStub.ENDPOINT_ADDRESS_PROPERTY,
                 loginResult.getServerUrl());
         SessionHeader sh = new SessionHeader();
         sh.setSessionId(loginResult.getSessionId());
         binding.setHeader(new HelloWorld2ServiceLocator().getServiceName().getNamespaceURI(),
                 "SessionHeader", sh);
     
   String a = binding.sayHelloWorld("s");
   System.out.print(a);
  } catch (ServiceException e) {
   // TODO Auto-generated catch block
   e.printStackTrace();
  }
 }
}
 
error
 
Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
 faultSubcode:
 faultString: No operation available for request {http://soap.sforce.com/schemas/class/HelloWorld2}sayHelloWorld
 faultActor:
 faultNode:
 faultDetail:
 {http://xml.apache.org/axis/}stackTrace:No operation available for request {http://soap.sforce.com/schemas/class/HelloWorld2}sayHelloWorld
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
 at javax.xml.parsers.SAXParser.parse(Unknown Source)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.sforce.soap.schemas._class.HelloWorld2.HelloWorld2BindingStub.sayHelloWorld(HelloWorld2BindingStub.java:214)
 at com.sforce.soap.schemas._class.HelloWorld2.WEBtest.main(WEBtest.java:37)
 {http://xml.apache.org/axis/}hostname:ck-b0de50bc7ace
No operation available for request {http://soap.sforce.com/schemas/class/HelloWorld2}sayHelloWorld
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
 at javax.xml.parsers.SAXParser.parse(Unknown Source)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at com.sforce.soap.schemas._class.HelloWorld2.HelloWorld2BindingStub.sayHelloWorld(HelloWorld2BindingStub.java:214)
 at com.sforce.soap.schemas._class.HelloWorld2.WEBtest.main(WEBtest.java:37)
I created APEX code
 
for example
 
global class  HelloWorld4{
 WebService static String sayHelloWorld(String arg) {
  return 'Hello '+arg; 
 } 
}
 
 
How can I use it in client?
 
Hi,
 
I created a webservice which accepts 2 string parameters. These 2 parameters are passed from my Java client. Can anyone please tell me how can I declare those 2 variables and pass it to my webservice thro' my Java client. Do I have to create a seperate method just to declare 2 variable?
 
Any help will be really appreciated.
 
Thanks,